diff options
author | Mike Pall <mike> | 2022-04-02 21:24:18 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2022-04-02 21:27:43 +0200 |
commit | 1cdff194cfa22cfe5bfc0e908b909e2dea40aa70 (patch) | |
tree | 3f32998ff919a48d2d9595e91f1d90c7807cb947 /src/lj_record.c | |
parent | e2c312e0deb874aa5fa8ce502c08d87deb38e82f (diff) | |
download | luajit-1cdff194cfa22cfe5bfc0e908b909e2dea40aa70.tar.gz luajit-1cdff194cfa22cfe5bfc0e908b909e2dea40aa70.tar.bz2 luajit-1cdff194cfa22cfe5bfc0e908b909e2dea40aa70.zip |
Add missing check for LJ_KEYINDEX in ITERN recording.
Reported by dragonorloong. Analyzed by vfprintf. #827
Diffstat (limited to 'src/lj_record.c')
-rw-r--r-- | src/lj_record.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lj_record.c b/src/lj_record.c index 59798844..d48908e2 100644 --- a/src/lj_record.c +++ b/src/lj_record.c | |||
@@ -675,7 +675,8 @@ static LoopEvent rec_itern(jit_State *J, BCReg ra, BCReg rb) | |||
675 | lj_snap_add(J); /* Required to make JLOOP the first ins in a side-trace. */ | 675 | lj_snap_add(J); /* Required to make JLOOP the first ins in a side-trace. */ |
676 | ix.tab = getslot(J, ra-2); | 676 | ix.tab = getslot(J, ra-2); |
677 | ix.key = J->base[ra-1] ? J->base[ra-1] : | 677 | ix.key = J->base[ra-1] ? J->base[ra-1] : |
678 | sloadt(J, (int32_t)(ra-1), IRT_INT, IRSLOAD_KEYINDEX); | 678 | sloadt(J, (int32_t)(ra-1), IRT_GUARD|IRT_INT, |
679 | IRSLOAD_TYPECHECK|IRSLOAD_KEYINDEX); | ||
679 | copyTV(J->L, &ix.tabv, &J->L->base[ra-2]); | 680 | copyTV(J->L, &ix.tabv, &J->L->base[ra-2]); |
680 | copyTV(J->L, &ix.keyv, &J->L->base[ra-1]); | 681 | copyTV(J->L, &ix.keyv, &J->L->base[ra-1]); |
681 | ix.idxchain = (rb < 3); /* Omit value type check, if unused. */ | 682 | ix.idxchain = (rb < 3); /* Omit value type check, if unused. */ |