summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--BCT/BytecodeTranslator/ExpressionTraverser.cs13
1 files changed, 10 insertions, 3 deletions
diff --git a/BCT/BytecodeTranslator/ExpressionTraverser.cs b/BCT/BytecodeTranslator/ExpressionTraverser.cs
index bcd9e785..db9da74c 100644
--- a/BCT/BytecodeTranslator/ExpressionTraverser.cs
+++ b/BCT/BytecodeTranslator/ExpressionTraverser.cs
@@ -179,7 +179,9 @@ namespace BytecodeTranslator
{
currSelectExpr = Bpl.Expr.Select(currSelectExpr, e);
}
- TranslatedExpressions.Push(currSelectExpr);
+ Bpl.IdentifierExpr temp = Bpl.Expr.Ident(this.sink.CreateFreshLocal(this.sink.CciTypeToBoogie(arrayIndexer.Type.ResolvedType)));
+ this.StmtTraverser.StmtBuilder.Add(TranslationHelper.BuildAssignCmd(temp, currSelectExpr));
+ TranslatedExpressions.Push(temp);
}
}
@@ -430,11 +432,11 @@ namespace BytecodeTranslator
List<IFieldDefinition> args = null;
if (!methodCall.IsStaticCall)
{
- Debug.Assert(this.args == null);
+ List<IFieldDefinition> savedArgs = this.args;
this.args = new List<IFieldDefinition>();
this.Visit(methodCall.ThisArgument);
args = this.args;
- this.args = null;
+ this.args = savedArgs;
thisExpr = this.TranslatedExpressions.Pop() as Bpl.IdentifierExpr;
locals = new List<Bpl.Variable>();
@@ -535,6 +537,11 @@ namespace BytecodeTranslator
ed = e;
break;
}
+ if (e.Remover != null && e.Remover.ResolvedMethod == resolvedMethod)
+ {
+ ed = e;
+ break;
+ }
}
Bpl.Variable eventVar = null;
Bpl.Variable local = null;