]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
Another loop formation test must check for return to lower frame.
authorMike Pall <mike>
Wed, 3 Feb 2010 13:31:42 +0000 (14:31 +0100)
committerMike Pall <mike>
Wed, 3 Feb 2010 13:31:42 +0000 (14:31 +0100)
src/lj_record.c

index cded81e09928c71564a0192c51a5c13f51739d5a..a32d19f063c9105fa02d859f6c8f6630fe0c6229 100644 (file)
@@ -401,7 +401,7 @@ static void rec_loop_jit(jit_State *J, TraceNo lnk, LoopEvent ev)
     lj_trace_err(J, LJ_TRERR_LINNER);
   } else if (ev != LOOPEV_LEAVE) {  /* Side trace enters a compiled loop. */
     J->instunroll = 0;  /* Cannot continue across a compiled loop op. */
-    if (J->pc == J->startpc && J->framedepth == 0)
+    if (J->pc == J->startpc && J->framedepth == 0 && !J->chain[IR_RETF])
       lnk = J->curtrace;  /* Can form an extra loop. */
     rec_stop(J, lnk);  /* Link to the loop. */
   }  /* Side trace continues across a loop that's left or not entered. */