summaryrefslogtreecommitdiff
path: root/BCT
diff options
context:
space:
mode:
authorGravatar mikebarnett <unknown>2011-01-21 06:46:20 +0000
committerGravatar mikebarnett <unknown>2011-01-21 06:46:20 +0000
commitd68fab2278b43f93563309a99ac9c4d25ac129e8 (patch)
tree65ddd920cb64f8b7da3711d091765ae732b4bf2a /BCT
parent115b3d54e06527160ad895274982d2a955160132 (diff)
Fix order of getting the instance and the field from the expression heap so that assignments are done correctly.
Diffstat (limited to 'BCT')
-rw-r--r--BCT/BytecodeTranslator/ExpressionTraverser.cs2
-rw-r--r--BCT/BytecodeTranslator/Heap.cs2
-rw-r--r--BCT/RegressionTests/TranslationTest/SplitFieldsHeapInput.txt2
3 files changed, 3 insertions, 3 deletions
diff --git a/BCT/BytecodeTranslator/ExpressionTraverser.cs b/BCT/BytecodeTranslator/ExpressionTraverser.cs
index ff47690d..150518b0 100644
--- a/BCT/BytecodeTranslator/ExpressionTraverser.cs
+++ b/BCT/BytecodeTranslator/ExpressionTraverser.cs
@@ -517,10 +517,10 @@ namespace BytecodeTranslator
var fieldReference = target.Definition as IFieldReference;
if (fieldReference != null) {
- Bpl.IdentifierExpr f = this.TranslatedExpressions.Pop() as Bpl.IdentifierExpr;
Bpl.Expr o = null;
if (target.Instance != null)
o = TranslatedExpressions.Pop();
+ Bpl.IdentifierExpr f = this.TranslatedExpressions.Pop() as Bpl.IdentifierExpr;
var c = this.sink.Heap.WriteHeap(assignment.Token(), o, f, sourceexp);
StmtTraverser.StmtBuilder.Add(c);
return;
diff --git a/BCT/BytecodeTranslator/Heap.cs b/BCT/BytecodeTranslator/Heap.cs
index 0ff10c0b..cfc30c97 100644
--- a/BCT/BytecodeTranslator/Heap.cs
+++ b/BCT/BytecodeTranslator/Heap.cs
@@ -115,7 +115,7 @@ procedure {:inline 1} Alloc() returns (x: int)
else
return
Bpl.Cmd.MapAssign(tok,
- new Bpl.IdentifierExpr(tok, this.HeapVariable), new Bpl.ExprSeq(f, o), value);
+ new Bpl.IdentifierExpr(tok, this.HeapVariable), new Bpl.ExprSeq(o, f), value);
}
diff --git a/BCT/RegressionTests/TranslationTest/SplitFieldsHeapInput.txt b/BCT/RegressionTests/TranslationTest/SplitFieldsHeapInput.txt
index 307d0eb5..6fc1bdf1 100644
--- a/BCT/RegressionTests/TranslationTest/SplitFieldsHeapInput.txt
+++ b/BCT/RegressionTests/TranslationTest/SplitFieldsHeapInput.txt
@@ -76,7 +76,7 @@ implementation RegressionTestInput.ClassWithBoolTypes..ctor$System.Void(this: in
z := z$in;
assert {:sourceFile "Class1.cs"} {:sourceLine 67} true;
assert {:sourceFile "Class1.cs"} {:sourceLine 68} true;
- this[RegressionTestInput.ClassWithBoolTypes.b] := z;
+ RegressionTestInput.ClassWithBoolTypes.b[this] := z;
if (z)
{
assert {:sourceFile "Class1.cs"} {:sourceLine 69} true;