]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
Loop formation test must check for return to lower frame.
authorMike Pall <mike>
Fri, 29 Jan 2010 14:07:40 +0000 (15:07 +0100)
committerMike Pall <mike>
Fri, 29 Jan 2010 14:07:40 +0000 (15:07 +0100)
src/lj_record.c

index 03fcb9661dba1da29583017790629bc6ed2b8d64..cded81e09928c71564a0192c51a5c13f51739d5a 100644 (file)
@@ -368,7 +368,8 @@ static int innerloopleft(jit_State *J, const BCIns *pc)
 static void rec_loop_interp(jit_State *J, const BCIns *pc, LoopEvent ev)
 {
   if (J->parent == 0) {
-    if (pc == J->startpc && J->framedepth == 0) {  /* Same loop? */
+    if (pc == J->startpc && J->framedepth == 0 && !J->chain[IR_RETF]) {
+      /* Same loop? */
       if (ev == LOOPEV_LEAVE)  /* Must loop back to form a root trace. */
        lj_trace_err(J, LJ_TRERR_LLEAVE);
       rec_stop(J, J->curtrace);  /* Root trace forms a loop. */