diff options
Diffstat (limited to 'src/lj_record.c')
-rw-r--r-- | src/lj_record.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lj_record.c b/src/lj_record.c index b7af5896..a9092d92 100644 --- a/src/lj_record.c +++ b/src/lj_record.c | |||
@@ -948,7 +948,7 @@ void lj_record_ret(jit_State *J, BCReg rbase, ptrdiff_t gotresults) | |||
948 | if ((pt->flags & PROTO_NOJIT)) | 948 | if ((pt->flags & PROTO_NOJIT)) |
949 | lj_trace_err(J, LJ_TRERR_CJITOFF); | 949 | lj_trace_err(J, LJ_TRERR_CJITOFF); |
950 | if (J->framedepth == 0 && J->pt && frame == J->L->base - 1) { | 950 | if (J->framedepth == 0 && J->pt && frame == J->L->base - 1) { |
951 | if (check_downrec_unroll(J, pt)) { | 951 | if (!J->cur.root && check_downrec_unroll(J, pt)) { |
952 | J->maxslot = (BCReg)(rbase + gotresults); | 952 | J->maxslot = (BCReg)(rbase + gotresults); |
953 | lj_snap_purge(J); | 953 | lj_snap_purge(J); |
954 | lj_record_stop(J, LJ_TRLINK_DOWNREC, J->cur.traceno); /* Down-rec. */ | 954 | lj_record_stop(J, LJ_TRLINK_DOWNREC, J->cur.traceno); /* Down-rec. */ |
@@ -970,6 +970,8 @@ void lj_record_ret(jit_State *J, BCReg rbase, ptrdiff_t gotresults) | |||
970 | lj_trace_err(J, LJ_TRERR_LLEAVE); | 970 | lj_trace_err(J, LJ_TRERR_LLEAVE); |
971 | } else if (J->needsnap) { /* Tailcalled to ff with side-effects. */ | 971 | } else if (J->needsnap) { /* Tailcalled to ff with side-effects. */ |
972 | lj_trace_err(J, LJ_TRERR_NYIRETL); /* No way to insert snapshot here. */ | 972 | lj_trace_err(J, LJ_TRERR_NYIRETL); /* No way to insert snapshot here. */ |
973 | } else if (1 + pt->framesize >= LJ_MAX_JSLOTS) { | ||
974 | lj_trace_err(J, LJ_TRERR_STACKOV); | ||
973 | } else { /* Return to lower frame. Guard for the target we return to. */ | 975 | } else { /* Return to lower frame. Guard for the target we return to. */ |
974 | TRef trpt = lj_ir_kgc(J, obj2gco(pt), IRT_PROTO); | 976 | TRef trpt = lj_ir_kgc(J, obj2gco(pt), IRT_PROTO); |
975 | TRef trpc = lj_ir_kptr(J, (void *)frame_pc(frame)); | 977 | TRef trpc = lj_ir_kptr(J, (void *)frame_pc(frame)); |