Fix Binexp code not cleaning up after itself
This commit is contained in:
parent
ba755de84c
commit
8d5879bb51
3 changed files with 9 additions and 3 deletions
|
@ -54,7 +54,9 @@ public class CodegenImpl implements Codegen {
|
||||||
+ "mv s1,a0\n"
|
+ "mv s1,a0\n"
|
||||||
+ compileExp(b.r)
|
+ compileExp(b.r)
|
||||||
+ "mv t1,a0\n"
|
+ "mv t1,a0\n"
|
||||||
+ compileExpBinop(b.binop);
|
+ compileExpBinop(b.binop)
|
||||||
|
+ "lw s1,(sp)\n"
|
||||||
|
+ "addi sp,sp,4\n";
|
||||||
} else if (e instanceof Variable) {
|
} else if (e instanceof Variable) {
|
||||||
int offset = ((Variable) e).x - 1;
|
int offset = ((Variable) e).x - 1;
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,9 @@ public class CodegenImpl implements Codegen {
|
||||||
+ "mv s1,a0\n"
|
+ "mv s1,a0\n"
|
||||||
+ compileExp(b.r)
|
+ compileExp(b.r)
|
||||||
+ "mv t1,a0\n"
|
+ "mv t1,a0\n"
|
||||||
+ compileExpBinop(b.binop);
|
+ compileExpBinop(b.binop)
|
||||||
|
+ "lw s1,(sp)\n"
|
||||||
|
+ "addi sp,sp,4\n";
|
||||||
} else if (e instanceof Variable) {
|
} else if (e instanceof Variable) {
|
||||||
int offset = ((Variable) e).x - 1;
|
int offset = ((Variable) e).x - 1;
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,9 @@ public class CodegenImpl implements Codegen {
|
||||||
+ "mv s1,a0\n"
|
+ "mv s1,a0\n"
|
||||||
+ compileExp(b.r)
|
+ compileExp(b.r)
|
||||||
+ "mv t1,a0\n"
|
+ "mv t1,a0\n"
|
||||||
+ compileExpBinop(b.binop);
|
+ compileExpBinop(b.binop)
|
||||||
|
+ "lw s1,(sp)\n"
|
||||||
|
+ "addi sp,sp,4\n";
|
||||||
} else if (e instanceof Variable) {
|
} else if (e instanceof Variable) {
|
||||||
int offset = ((Variable) e).x - 1;
|
int offset = ((Variable) e).x - 1;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue