Fix Binexp code not cleaning up after itself

This commit is contained in:
Henry 2019-12-20 16:28:38 +00:00
parent ba755de84c
commit 8d5879bb51
3 changed files with 9 additions and 3 deletions

View File

@ -54,7 +54,9 @@ public class CodegenImpl implements Codegen {
+ "mv s1,a0\n"
+ compileExp(b.r)
+ "mv t1,a0\n"
+ compileExpBinop(b.binop);
+ compileExpBinop(b.binop)
+ "lw s1,(sp)\n"
+ "addi sp,sp,4\n";
} else if (e instanceof Variable) {
int offset = ((Variable) e).x - 1;

View File

@ -54,7 +54,9 @@ public class CodegenImpl implements Codegen {
+ "mv s1,a0\n"
+ compileExp(b.r)
+ "mv t1,a0\n"
+ compileExpBinop(b.binop);
+ compileExpBinop(b.binop)
+ "lw s1,(sp)\n"
+ "addi sp,sp,4\n";
} else if (e instanceof Variable) {
int offset = ((Variable) e).x - 1;

View File

@ -54,7 +54,9 @@ public class CodegenImpl implements Codegen {
+ "mv s1,a0\n"
+ compileExp(b.r)
+ "mv t1,a0\n"
+ compileExpBinop(b.binop);
+ compileExpBinop(b.binop)
+ "lw s1,(sp)\n"
+ "addi sp,sp,4\n";
} else if (e instanceof Variable) {
int offset = ((Variable) e).x - 1;