Browse Source

ARM64: Fix code generation for IR_SLOAD with typecheck + conversion.

Reported by memcorrupt.
Mike Pall 2 years ago
parent
commit
564147f518
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/lj_asm_arm64.h

+ 1 - 1
src/lj_asm_arm64.h

@@ -1201,7 +1201,7 @@ dotypecheck:
       tmp = ra_scratch(as, allow);
       rset_clear(allow, tmp);
     }
-    if (ra_hasreg(dest) && irt_isnum(t) && !(ir->op2 & IRSLOAD_CONVERT))
+    if (ra_hasreg(dest) && tmp != dest)
       emit_dn(as, A64I_FMOV_D_R, (dest & 31), tmp);
     /* Need type check, even if the load result is unused. */
     asm_guardcc(as, irt_isnum(t) ? CC_LS : CC_NE);