Merge branch 'master' into v2.1

This commit is contained in:
Mike Pall 2024-09-29 16:11:15 +02:00
commit 0ae532c9aa
2 changed files with 3 additions and 9 deletions

View File

@ -239,12 +239,6 @@ typedef struct UndocumentedDispatcherContext {
/* Another wild guess. */
extern void __DestructExceptionObject(EXCEPTION_RECORD *rec, int nothrow);
#if LJ_TARGET_X64 && defined(MINGW_SDK_INIT)
/* Workaround for broken MinGW64 declaration. */
VOID RtlUnwindEx_FIXED(PVOID,PVOID,PVOID,PVOID,PVOID,PVOID) asm("RtlUnwindEx");
#define RtlUnwindEx RtlUnwindEx_FIXED
#endif
#define LJ_MSVC_EXCODE ((DWORD)0xe06d7363)
#define LJ_GCC_EXCODE ((DWORD)0x20474343)

View File

@ -1074,6 +1074,7 @@ int lj_record_mm_lookup(jit_State *J, RecordIndex *ix, MMS mm)
} else if (tref_isudata(ix->tab)) {
int udtype = udataV(&ix->tabv)->udtype;
mt = tabref(udataV(&ix->tabv)->metatable);
mix.tab = emitir(IRT(IR_FLOAD, IRT_TAB), ix->tab, IRFL_UDATA_META);
/* The metatables of special userdata objects are treated as immutable. */
if (udtype != UDTYPE_USERDATA) {
cTValue *mo;
@ -1087,6 +1088,8 @@ int lj_record_mm_lookup(jit_State *J, RecordIndex *ix, MMS mm)
}
immutable_mt:
mo = lj_tab_getstr(mt, mmname_str(J2G(J), mm));
ix->mt = mix.tab;
ix->mtv = mt;
if (!mo || tvisnil(mo))
return 0; /* No metamethod. */
/* Treat metamethod or index table as immutable, too. */
@ -1094,11 +1097,8 @@ int lj_record_mm_lookup(jit_State *J, RecordIndex *ix, MMS mm)
lj_trace_err(J, LJ_TRERR_BADTYPE);
copyTV(J->L, &ix->mobjv, mo);
ix->mobj = lj_ir_kgc(J, gcV(mo), tvisfunc(mo) ? IRT_FUNC : IRT_TAB);
ix->mtv = mt;
ix->mt = TREF_NIL; /* Dummy value for comparison semantics. */
return 1; /* Got metamethod or index table. */
}
mix.tab = emitir(IRT(IR_FLOAD, IRT_TAB), ix->tab, IRFL_UDATA_META);
} else {
/* Specialize to base metatable. Must flush mcode in lua_setmetatable(). */
mt = tabref(basemt_obj(J2G(J), &ix->tabv));