Bläddra i källkod

Respect jit.off(func) when returning to a function, too.

Mike Pall 11 år sedan
förälder
incheckning
f371ed6bd8
2 ändrade filer med 3 tillägg och 1 borttagningar
  1. 2 0
      src/lj_record.c
  2. 1 1
      src/lj_traceerr.h

+ 2 - 0
src/lj_record.c

@@ -722,6 +722,8 @@ void lj_record_ret(jit_State *J, BCReg rbase, ptrdiff_t gotresults)
     ptrdiff_t nresults = bc_b(callins) ? (ptrdiff_t)bc_b(callins)-1 :gotresults;
     BCReg cbase = bc_a(callins);
     GCproto *pt = funcproto(frame_func(frame - (cbase+1)));
+    if ((pt->flags & PROTO_NOJIT))
+      lj_trace_err(J, LJ_TRERR_CJITOFF);
     if (J->framedepth == 0 && J->pt && frame == J->L->base - 1) {
       if (check_downrec_unroll(J, pt)) {
 	J->maxslot = (BCReg)(rbase + gotresults);

+ 1 - 1
src/lj_traceerr.h

@@ -20,7 +20,7 @@ TREDEF(LUNROLL,	"loop unroll limit reached")
 
 /* Recording calls/returns. */
 TREDEF(BADTYPE,	"bad argument type")
-TREDEF(CJITOFF,	"call to JIT-disabled function")
+TREDEF(CJITOFF,	"JIT compilation disabled for function")
 TREDEF(CUNROLL,	"call unroll limit reached")
 TREDEF(DOWNREC,	"down-recursion, restarting")
 TREDEF(NYICF,	"NYI: C function %p")