move float result into rax before further processing

This commit is contained in:
2020-03-09 16:09:15 +01:00
parent cb5ceafbbc
commit 704e6441ca

View File

@@ -568,6 +568,11 @@ public class GenASM implements Visitor<Void> {
if (e.expression != null) {
e.expression.welcome(this);
int offset = this.env.get(e.name);
if (e.expression.type.equals(Type.getFloatType())) {
this.ex.write(" movq %xmm0, %rax\n");
}
this.ex.write(" movq %rax, " + offset + "(%rbp)\n");
}
return null;