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

Reported by memcorrupt.
This commit is contained in:
Mike Pall 2022-12-01 12:03:09 +01:00
parent 637721d00f
commit 564147f518

View 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);