Fix: Subtraction tests not working. Was: incorrect order of expression evaluation

This commit is contained in:
Marvin Kaiser
2019-12-17 16:53:20 +01:00
parent c8bca94ca8
commit 5745062704

View File

@@ -86,9 +86,9 @@ public class GenASM implements Visitor<Void> {
@Override
public Void visit(SubstractionExpression e) {
e.lhs.welcome(this);
this.ex.write(" pushq %rax\n");
e.rhs.welcome(this);
this.ex.write(" pushq %rax\n");
e.lhs.welcome(this);
this.ex.write(" popq %rbx\n");
this.ex.write(" subq %rbx, %rax\n");
return null;