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

@@ -1209,7 +1209,7 @@ dotypecheck:
lj_assertA(irt_isinteger(t) || irt_isnum(t),
"bad SLOAD type %d", irt_type(t));
emit_nm(as, A64I_CMPx | A64F_SH(A64SH_LSR, 32),
ra_allock(as, LJ_TISNUM << 15, allow), tmp);
ra_allock(as, (ir->op2 & IRSLOAD_KEYINDEX) ? LJ_KEYINDEX : (LJ_TISNUM << 15), allow), tmp);
} else if (irt_isnil(t)) {
emit_n(as, (A64I_CMNx^A64I_K12) | A64F_U12(1), tmp);
} else if (irt_ispri(t)) {