diff --git a/src/compiler/ir/IRCodeGenerator.java b/src/compiler/ir/IRCodeGenerator.java index 9c29f16..7256f21 100644 --- a/src/compiler/ir/IRCodeGenerator.java +++ b/src/compiler/ir/IRCodeGenerator.java @@ -114,9 +114,8 @@ public void visit(Binary binary) { operator = BinopExpr.Operator.ADD; BinopExpr offset = new BinopExpr(leftExpr, index, operator); - imcCode.store(types.valueFor(), binary) + imcCode.store(types.valueFor(binary).get().isArray() ? offset : new MemExpr(offset), binary); } - } @Override