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 20a7ea36..1d535a22 100644 --- a/src/lj_record.c +++ b/src/lj_record.c | |||
@@ -749,7 +749,8 @@ void lj_record_ret(jit_State *J, BCReg rbase, ptrdiff_t gotresults) | |||
749 | lj_trace_err(J, LJ_TRERR_LLEAVE); | 749 | lj_trace_err(J, LJ_TRERR_LLEAVE); |
750 | } else if (J->needsnap) { /* Tailcalled to ff with side-effects. */ | 750 | } else if (J->needsnap) { /* Tailcalled to ff with side-effects. */ |
751 | lj_trace_err(J, LJ_TRERR_NYIRETL); /* No way to insert snapshot here. */ | 751 | lj_trace_err(J, LJ_TRERR_NYIRETL); /* No way to insert snapshot here. */ |
752 | } else if (1 + pt->framesize >= LJ_MAX_JSLOTS) { | 752 | } else if (1 + pt->framesize >= LJ_MAX_JSLOTS || |
753 | J->baseslot + J->maxslot >= LJ_MAX_JSLOTS) { | ||
753 | lj_trace_err(J, LJ_TRERR_STACKOV); | 754 | lj_trace_err(J, LJ_TRERR_STACKOV); |
754 | } else { /* Return to lower frame. Guard for the target we return to. */ | 755 | } else { /* Return to lower frame. Guard for the target we return to. */ |
755 | TRef trpt = lj_ir_kgc(J, obj2gco(pt), IRT_PROTO); | 756 | TRef trpt = lj_ir_kgc(J, obj2gco(pt), IRT_PROTO); |
@@ -854,7 +855,10 @@ int lj_record_mm_lookup(jit_State *J, RecordIndex *ix, MMS mm) | |||
854 | return 0; /* No metamethod. */ | 855 | return 0; /* No metamethod. */ |
855 | } | 856 | } |
856 | /* The cdata metatable is treated as immutable. */ | 857 | /* The cdata metatable is treated as immutable. */ |
857 | if (LJ_HASFFI && tref_iscdata(ix->tab)) goto immutable_mt; | 858 | if (LJ_HASFFI && tref_iscdata(ix->tab)) { |
859 | mix.tab = TREF_NIL; | ||
860 | goto immutable_mt; | ||
861 | } | ||
858 | ix->mt = mix.tab = lj_ir_ktab(J, mt); | 862 | ix->mt = mix.tab = lj_ir_ktab(J, mt); |
859 | goto nocheck; | 863 | goto nocheck; |
860 | } | 864 | } |