]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
Add missing check for return to lower frame.
authorMike Pall <mike>
Wed, 27 Jan 2010 00:57:15 +0000 (01:57 +0100)
committerMike Pall <mike>
Wed, 27 Jan 2010 00:57:15 +0000 (01:57 +0100)
src/lj_record.c

index 3f4420888135fbfa1ebda92a3c9750138368cd4d..c14a9e8656abd121d56b150869560a5891e50b79 100644 (file)
@@ -1510,12 +1510,13 @@ static void rec_ret(jit_State *J, BCReg rbase, int gotresults)
   J->tailcalled = 0;
   while (frame_ispcall(frame)) {
     BCReg cbase = (BCReg)frame_delta(frame);
+    if (J->framedepth-- <= 0)
+      lj_trace_err(J, LJ_TRERR_NYIRETL);
     lua_assert(J->baseslot > 1);
     J->baseslot -= (BCReg)cbase;
     J->base -= cbase;
     *--res = TREF_TRUE;  /* Prepend true to results. */
     gotresults++;
-    J->framedepth--;
     frame = frame_prevd(frame);
   }
   if (J->framedepth-- <= 0)