summaryrefslogtreecommitdiff
path: root/BCT
diff options
context:
space:
mode:
authorGravatar qadeer <qadeer@microsoft.com>2011-08-17 22:21:56 -0700
committerGravatar qadeer <qadeer@microsoft.com>2011-08-17 22:21:56 -0700
commitdf0b1a77732738e0793a94cd75d7332b78085481 (patch)
treebaa23d3e5b67e1eef275780edc8dd0791bd206e5 /BCT
parentfe77fdfec07edc2802395079ec3b6ab05c51118d (diff)
fix in event translation for whole program analysis
Diffstat (limited to 'BCT')
-rw-r--r--BCT/BytecodeTranslator/WholeProgram.cs9
1 files changed, 8 insertions, 1 deletions
diff --git a/BCT/BytecodeTranslator/WholeProgram.cs b/BCT/BytecodeTranslator/WholeProgram.cs
index b7611375..83541f7d 100644
--- a/BCT/BytecodeTranslator/WholeProgram.cs
+++ b/BCT/BytecodeTranslator/WholeProgram.cs
@@ -101,6 +101,14 @@ namespace BytecodeTranslator {
}
public override void Visit(IMethodCall methodCall) {
+ var resolvedMethod = Sink.Unspecialize(methodCall.MethodToCall).ResolvedMethod;
+
+ bool isEventAdd = resolvedMethod.IsSpecialName && resolvedMethod.Name.Value.StartsWith("add_");
+ bool isEventRemove = resolvedMethod.IsSpecialName && resolvedMethod.Name.Value.StartsWith("remove_");
+ if (isEventAdd || isEventRemove) {
+ base.Visit(methodCall);
+ return;
+ }
if (!methodCall.IsVirtualCall) {
base.Visit(methodCall);
@@ -114,7 +122,6 @@ namespace BytecodeTranslator {
}
Contract.Assert(0 < subTypesOfContainingType.Count);
Contract.Assert(!methodCall.IsStaticCall);
- var resolvedMethod = methodCall.MethodToCall.ResolvedMethod;
Contract.Assert(!resolvedMethod.IsConstructor);
var overrides = FindOverrides(containingType, resolvedMethod);
if (0 == overrides.Count) {