diff options
author | 2011-04-28 22:09:42 -0700 | |
---|---|---|
committer | 2011-04-28 22:09:42 -0700 | |
commit | 77b0bc8bdb1c904760c48a8faca2c00233632659 (patch) | |
tree | a2f80a9a6ce60af2548985f80b3d9f918a0c4f30 | |
parent | dfb4e6c3a65c8bf7cd95bfe27bf5a33ba0c73f3c (diff) |
fixed a bug in struct handling
-rw-r--r-- | BCT/BytecodeTranslator/ExpressionTraverser.cs | 13 |
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;
|