diff options
-rw-r--r-- | src/lj_trace.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/lj_trace.c b/src/lj_trace.c index 2bb2075d..0542ea1f 100644 --- a/src/lj_trace.c +++ b/src/lj_trace.c | |||
@@ -545,9 +545,13 @@ static int trace_abort(jit_State *J) | |||
545 | /* Perform pending re-patch of a bytecode instruction. */ | 545 | /* Perform pending re-patch of a bytecode instruction. */ |
546 | static LJ_AINLINE void trace_pendpatch(jit_State *J, int force) | 546 | static LJ_AINLINE void trace_pendpatch(jit_State *J, int force) |
547 | { | 547 | { |
548 | if (LJ_UNLIKELY(J->patchpc) && (force || J->chain[IR_RETF])) { | 548 | if (LJ_UNLIKELY(J->patchpc)) { |
549 | *J->patchpc = J->patchins; | 549 | if (force || J->bcskip == 0) { |
550 | J->patchpc = NULL; | 550 | *J->patchpc = J->patchins; |
551 | J->patchpc = NULL; | ||
552 | } else { | ||
553 | J->bcskip = 0; | ||
554 | } | ||
551 | } | 555 | } |
552 | } | 556 | } |
553 | 557 | ||
@@ -769,6 +773,7 @@ int LJ_FASTCALL lj_trace_exit(jit_State *J, void *exptr) | |||
769 | J->patchins = *pc; | 773 | J->patchins = *pc; |
770 | J->patchpc = (BCIns *)pc; | 774 | J->patchpc = (BCIns *)pc; |
771 | *J->patchpc = *retpc; | 775 | *J->patchpc = *retpc; |
776 | J->bcskip = 1; | ||
772 | } else { | 777 | } else { |
773 | pc = retpc; | 778 | pc = retpc; |
774 | setcframe_pc(cf, pc); | 779 | setcframe_pc(cf, pc); |