Add missing check for LJ_KEYINDEX in ITERN recording.

Reported by dragonorloong. Analyzed by vfprintf. #827
This commit is contained in:
Mike Pall
2022-04-02 21:24:18 +02:00
parent e2c312e0de
commit 1cdff194cf
6 changed files with 39 additions and 12 deletions

View File

@@ -1250,7 +1250,12 @@ dotypecheck:
}
}
asm_guardcc(as, t == IRT_NUM ? CC_HS : CC_NE);
emit_n(as, ARMI_CMN|ARMI_K12|-irt_toitype_(t), type);
if ((ir->op2 & IRSLOAD_KEYINDEX)) {
emit_n(as, ARMI_CMN|ARMI_K12|1, type);
emit_dn(as, ARMI_EOR^emit_isk12(ARMI_EOR, ~LJ_KEYINDEX), type, type);
} else {
emit_n(as, ARMI_CMN|ARMI_K12|-irt_toitype_(t), type);
}
}
if (ra_hasreg(dest)) {
#if !LJ_SOFTFP