This commit is contained in:
Jude Melton-Houghton 2025-04-14 22:07:40 +08:00 committed by GitHub
commit 28c2d7edf1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2532,6 +2532,12 @@ void lj_record_ins(jit_State *J)
case BC_GGET: case BC_GSET:
settabV(J->L, &ix.tabv, tabref(J->fn->l.env));
ix.tab = emitir(IRT(IR_FLOAD, IRT_TAB), getcurrf(J), IRFL_FUNC_ENV);
if (gcrefeq(J->fn->l.env, J->L->env)) {
/* Specialize to the global environment. */
TRef ktab = lj_ir_ktab(J, tabref(J->fn->l.env));
emitir(IRTG(IR_EQ, IRT_TAB), ix.tab, ktab);
ix.tab = ktab;
}
ix.idxchain = LJ_MAX_IDXCHAIN;
rc = lj_record_idx(J, &ix);
break;