]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
ARM64: Fix code generation for IR_SLOAD with typecheck + conversion.
authorMike Pall <mike>
Thu, 1 Dec 2022 11:03:09 +0000 (12:03 +0100)
committerMike Pall <mike>
Thu, 1 Dec 2022 11:03:09 +0000 (12:03 +0100)
Reported by memcorrupt.

src/lj_asm_arm64.h

index 4b7066f2827fc23fcf502a0d47e9e3ccf8c9ce18..4e34b3bebe9e030c3050d303d7d416ab992ceaf2 100644 (file)
@@ -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);