Another loop formation test must check for return to lower frame.

This commit is contained in:
Mike Pall 2010-02-03 14:31:42 +01:00
parent 61c5a60dc3
commit 305ecbbb84

View File

@ -401,7 +401,7 @@ static void rec_loop_jit(jit_State *J, TraceNo lnk, LoopEvent ev)
lj_trace_err(J, LJ_TRERR_LINNER); lj_trace_err(J, LJ_TRERR_LINNER);
} else if (ev != LOOPEV_LEAVE) { /* Side trace enters a compiled loop. */ } else if (ev != LOOPEV_LEAVE) { /* Side trace enters a compiled loop. */
J->instunroll = 0; /* Cannot continue across a compiled loop op. */ 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. */ lnk = J->curtrace; /* Can form an extra loop. */
rec_stop(J, lnk); /* Link to the loop. */ rec_stop(J, lnk); /* Link to the loop. */
} /* Side trace continues across a loop that's left or not entered. */ } /* Side trace continues across a loop that's left or not entered. */