summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Unknown <mbarnett@MIKE-SONY.redmond.corp.microsoft.com>2012-09-09 16:53:37 -0700
committerGravatar Unknown <mbarnett@MIKE-SONY.redmond.corp.microsoft.com>2012-09-09 16:53:37 -0700
commiteb3a412020c6a23fa5bc413f5108d8889748722d (patch)
treebe7350fb84769f09cd06de7402e31b8f33e8d044
parentcd30842abcbd514c49c18a596bdb45577a0630fa (diff)
Avoid creating a dynamic dispatch table for GetHashCode and ToString: it ends
up creating code that the Boogie parser gets a stack overflow while trying to parse!
-rw-r--r--BCT/BytecodeTranslator/WholeProgram.cs6
1 files changed, 6 insertions, 0 deletions
diff --git a/BCT/BytecodeTranslator/WholeProgram.cs b/BCT/BytecodeTranslator/WholeProgram.cs
index 9f4d83f2..c4b2aca2 100644
--- a/BCT/BytecodeTranslator/WholeProgram.cs
+++ b/BCT/BytecodeTranslator/WholeProgram.cs
@@ -117,6 +117,12 @@ namespace BytecodeTranslator {
public override void TraverseChildren(IMethodCall methodCall) {
var resolvedMethod = Sink.Unspecialize(methodCall.MethodToCall).ResolvedMethod;
+ var methodName = Microsoft.Cci.MemberHelper.GetMethodSignature(resolvedMethod);
+ if (methodName.Equals("System.Object.GetHashCode") || methodName.Equals("System.Object.ToString")) {
+ base.TraverseChildren(methodCall);
+ return;
+ }
+
bool isEventAdd = resolvedMethod.IsSpecialName && resolvedMethod.Name.Value.StartsWith("add_");
bool isEventRemove = resolvedMethod.IsSpecialName && resolvedMethod.Name.Value.StartsWith("remove_");
if (isEventAdd || isEventRemove) {