Fix: Subtraction tests not working. Was: incorrect order of expression evaluation
This commit is contained in:
@@ -86,9 +86,9 @@ public class GenASM implements Visitor<Void> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Void visit(SubstractionExpression e) {
|
public Void visit(SubstractionExpression e) {
|
||||||
e.lhs.welcome(this);
|
|
||||||
this.ex.write(" pushq %rax\n");
|
|
||||||
e.rhs.welcome(this);
|
e.rhs.welcome(this);
|
||||||
|
this.ex.write(" pushq %rax\n");
|
||||||
|
e.lhs.welcome(this);
|
||||||
this.ex.write(" popq %rbx\n");
|
this.ex.write(" popq %rbx\n");
|
||||||
this.ex.write(" subq %rbx, %rax\n");
|
this.ex.write(" subq %rbx, %rax\n");
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
Reference in New Issue
Block a user