aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lj_err.c6
-rw-r--r--src/lj_record.c6
2 files changed, 3 insertions, 9 deletions
diff --git a/src/lj_err.c b/src/lj_err.c
index 414ef477..b0ceaa2f 100644
--- a/src/lj_err.c
+++ b/src/lj_err.c
@@ -239,12 +239,6 @@ typedef struct UndocumentedDispatcherContext {
239/* Another wild guess. */ 239/* Another wild guess. */
240extern void __DestructExceptionObject(EXCEPTION_RECORD *rec, int nothrow); 240extern void __DestructExceptionObject(EXCEPTION_RECORD *rec, int nothrow);
241 241
242#if LJ_TARGET_X64 && defined(MINGW_SDK_INIT)
243/* Workaround for broken MinGW64 declaration. */
244VOID RtlUnwindEx_FIXED(PVOID,PVOID,PVOID,PVOID,PVOID,PVOID) asm("RtlUnwindEx");
245#define RtlUnwindEx RtlUnwindEx_FIXED
246#endif
247
248#define LJ_MSVC_EXCODE ((DWORD)0xe06d7363) 242#define LJ_MSVC_EXCODE ((DWORD)0xe06d7363)
249#define LJ_GCC_EXCODE ((DWORD)0x20474343) 243#define LJ_GCC_EXCODE ((DWORD)0x20474343)
250 244
diff --git a/src/lj_record.c b/src/lj_record.c
index 3ba2ce8b..fedd47a6 100644
--- a/src/lj_record.c
+++ b/src/lj_record.c
@@ -1074,6 +1074,7 @@ int lj_record_mm_lookup(jit_State *J, RecordIndex *ix, MMS mm)
1074 } else if (tref_isudata(ix->tab)) { 1074 } else if (tref_isudata(ix->tab)) {
1075 int udtype = udataV(&ix->tabv)->udtype; 1075 int udtype = udataV(&ix->tabv)->udtype;
1076 mt = tabref(udataV(&ix->tabv)->metatable); 1076 mt = tabref(udataV(&ix->tabv)->metatable);
1077 mix.tab = emitir(IRT(IR_FLOAD, IRT_TAB), ix->tab, IRFL_UDATA_META);
1077 /* The metatables of special userdata objects are treated as immutable. */ 1078 /* The metatables of special userdata objects are treated as immutable. */
1078 if (udtype != UDTYPE_USERDATA) { 1079 if (udtype != UDTYPE_USERDATA) {
1079 cTValue *mo; 1080 cTValue *mo;
@@ -1087,6 +1088,8 @@ int lj_record_mm_lookup(jit_State *J, RecordIndex *ix, MMS mm)
1087 } 1088 }
1088 immutable_mt: 1089 immutable_mt:
1089 mo = lj_tab_getstr(mt, mmname_str(J2G(J), mm)); 1090 mo = lj_tab_getstr(mt, mmname_str(J2G(J), mm));
1091 ix->mt = mix.tab;
1092 ix->mtv = mt;
1090 if (!mo || tvisnil(mo)) 1093 if (!mo || tvisnil(mo))
1091 return 0; /* No metamethod. */ 1094 return 0; /* No metamethod. */
1092 /* Treat metamethod or index table as immutable, too. */ 1095 /* Treat metamethod or index table as immutable, too. */
@@ -1094,11 +1097,8 @@ int lj_record_mm_lookup(jit_State *J, RecordIndex *ix, MMS mm)
1094 lj_trace_err(J, LJ_TRERR_BADTYPE); 1097 lj_trace_err(J, LJ_TRERR_BADTYPE);
1095 copyTV(J->L, &ix->mobjv, mo); 1098 copyTV(J->L, &ix->mobjv, mo);
1096 ix->mobj = lj_ir_kgc(J, gcV(mo), tvisfunc(mo) ? IRT_FUNC : IRT_TAB); 1099 ix->mobj = lj_ir_kgc(J, gcV(mo), tvisfunc(mo) ? IRT_FUNC : IRT_TAB);
1097 ix->mtv = mt;
1098 ix->mt = TREF_NIL; /* Dummy value for comparison semantics. */
1099 return 1; /* Got metamethod or index table. */ 1100 return 1; /* Got metamethod or index table. */
1100 } 1101 }
1101 mix.tab = emitir(IRT(IR_FLOAD, IRT_TAB), ix->tab, IRFL_UDATA_META);
1102 } else { 1102 } else {
1103 /* Specialize to base metatable. Must flush mcode in lua_setmetatable(). */ 1103 /* Specialize to base metatable. Must flush mcode in lua_setmetatable(). */
1104 mt = tabref(basemt_obj(J2G(J), &ix->tabv)); 1104 mt = tabref(basemt_obj(J2G(J), &ix->tabv));