summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--BCT/BytecodeTranslator/ExpressionTraverser.cs6
-rw-r--r--BCT/BytecodeTranslator/Sink.cs4
2 files changed, 5 insertions, 5 deletions
diff --git a/BCT/BytecodeTranslator/ExpressionTraverser.cs b/BCT/BytecodeTranslator/ExpressionTraverser.cs
index b15b48ec..9930c3c9 100644
--- a/BCT/BytecodeTranslator/ExpressionTraverser.cs
+++ b/BCT/BytecodeTranslator/ExpressionTraverser.cs
@@ -157,7 +157,7 @@ namespace BytecodeTranslator
indexExpr = new Bpl.NAryExpr(arrayIndexer.Token(), new Bpl.FunctionCall(f), new Bpl.ExprSeq(indexExprs));
}
- this.TranslatedExpressions.Push(arrayExpr);
+ this.TranslatedExpressions.Push(this.sink.Heap.ReadHeap(arrayExpr, indexExpr, AccessType.Array, this.sink.CciTypeToBoogie(arrayIndexer.Type)));
}
public override void Visit(ITargetExpression targetExpression)
@@ -620,7 +620,7 @@ namespace BytecodeTranslator
var translateAsFunctionCall = proc is Bpl.Function;
if (!translateAsFunctionCall) {
if (resolvedMethod.Type.ResolvedType.TypeCode != PrimitiveTypeCode.Void) {
- Bpl.Variable v = this.sink.CreateFreshLocal(resolvedMethod.Type.ResolvedType);
+ Bpl.Variable v = this.sink.CreateFreshLocal(methodToCall.ResolvedMethod.Type.ResolvedType);
Bpl.IdentifierExpr unboxed = new Bpl.IdentifierExpr(token, v);
if (resolvedMethod.Type is IGenericTypeParameter) {
Bpl.IdentifierExpr boxed = Bpl.Expr.Ident(this.sink.CreateFreshLocal(this.sink.Heap.BoxType));
@@ -1482,7 +1482,7 @@ namespace BytecodeTranslator
var loc = new LocalDefinition() {
Name = this.host.NameTable.GetNameFor("_loc" + this.sink.LocalCounter.ToString()),
- Type = arrayIndexer.Type,
+ Type = arrayIndexer.IndexedObject.Type
};
var locDecl = new LocalDeclarationStatement() {
InitialValue = e,
diff --git a/BCT/BytecodeTranslator/Sink.cs b/BCT/BytecodeTranslator/Sink.cs
index 127317e9..6bde28ec 100644
--- a/BCT/BytecodeTranslator/Sink.cs
+++ b/BCT/BytecodeTranslator/Sink.cs
@@ -600,8 +600,8 @@ namespace BytecodeTranslator {
// also, should it return true for properties and all of the other things the tools
// consider pure?
private bool IsPure(IMethodDefinition method) {
- bool isPropertyGetter = method.IsSpecialName && method.Name.Value.StartsWith("get_");
- if (isPropertyGetter) return true;
+ //bool isPropertyGetter = method.IsSpecialName && method.Name.Value.StartsWith("get_");
+ //if (isPropertyGetter) return true;
foreach (var a in method.Attributes) {
if (TypeHelper.GetTypeName(a.Type).EndsWith("PureAttribute")) {