diff options
Diffstat (limited to 'src/lj_record.c')
-rw-r--r-- | src/lj_record.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lj_record.c b/src/lj_record.c index c6a082d4..6543f274 100644 --- a/src/lj_record.c +++ b/src/lj_record.c | |||
@@ -973,7 +973,8 @@ void lj_record_ret(jit_State *J, BCReg rbase, ptrdiff_t gotresults) | |||
973 | lj_trace_err(J, LJ_TRERR_LLEAVE); | 973 | lj_trace_err(J, LJ_TRERR_LLEAVE); |
974 | } else if (J->needsnap) { /* Tailcalled to ff with side-effects. */ | 974 | } else if (J->needsnap) { /* Tailcalled to ff with side-effects. */ |
975 | lj_trace_err(J, LJ_TRERR_NYIRETL); /* No way to insert snapshot here. */ | 975 | lj_trace_err(J, LJ_TRERR_NYIRETL); /* No way to insert snapshot here. */ |
976 | } else if (1 + pt->framesize >= LJ_MAX_JSLOTS) { | 976 | } else if (1 + pt->framesize >= LJ_MAX_JSLOTS || |
977 | J->baseslot + J->maxslot >= LJ_MAX_JSLOTS) { | ||
977 | lj_trace_err(J, LJ_TRERR_STACKOV); | 978 | lj_trace_err(J, LJ_TRERR_STACKOV); |
978 | } else { /* Return to lower frame. Guard for the target we return to. */ | 979 | } else { /* Return to lower frame. Guard for the target we return to. */ |
979 | TRef trpt = lj_ir_kgc(J, obj2gco(pt), IRT_PROTO); | 980 | TRef trpt = lj_ir_kgc(J, obj2gco(pt), IRT_PROTO); |
@@ -1107,7 +1108,10 @@ int lj_record_mm_lookup(jit_State *J, RecordIndex *ix, MMS mm) | |||
1107 | return 0; /* No metamethod. */ | 1108 | return 0; /* No metamethod. */ |
1108 | } | 1109 | } |
1109 | /* The cdata metatable is treated as immutable. */ | 1110 | /* The cdata metatable is treated as immutable. */ |
1110 | if (LJ_HASFFI && tref_iscdata(ix->tab)) goto immutable_mt; | 1111 | if (LJ_HASFFI && tref_iscdata(ix->tab)) { |
1112 | mix.tab = TREF_NIL; | ||
1113 | goto immutable_mt; | ||
1114 | } | ||
1111 | ix->mt = mix.tab = lj_ir_ggfload(J, IRT_TAB, | 1115 | ix->mt = mix.tab = lj_ir_ggfload(J, IRT_TAB, |
1112 | GG_OFS(g.gcroot[GCROOT_BASEMT+itypemap(&ix->tabv)])); | 1116 | GG_OFS(g.gcroot[GCROOT_BASEMT+itypemap(&ix->tabv)])); |
1113 | goto nocheck; | 1117 | goto nocheck; |