Skip to content

Commit

Permalink
Merge branch 'PHP-8.3'
Browse files Browse the repository at this point in the history
* PHP-8.3:
  Fix GH-14475: PHP 8.3.7 with JIT encounters infinite loop on specific paths (#14558)
  • Loading branch information
dstogov committed Jun 17, 2024
2 parents 1fc083e + e842ddf commit 1f48715
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion ext/opcache/jit/zend_jit_trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -8627,7 +8627,20 @@ int ZEND_FASTCALL zend_jit_trace_exit(uint32_t exit_num, zend_jit_registers_buf
if (!(ZEND_OP_TRACE_INFO(t->opline, jit_extension->offset)->trace_flags & (ZEND_JIT_TRACE_JITED|ZEND_JIT_TRACE_BLACKLISTED))) {
/* skip: not JIT-ed nor blacklisted */
} else if (ZEND_JIT_TRACE_NUM >= JIT_G(max_root_traces)) {
/* skip: too many root traces */
/* too many root traces, blacklist the root trace */
if (!(ZEND_OP_TRACE_INFO(t->opline, jit_extension->offset)->trace_flags & ZEND_JIT_TRACE_BLACKLISTED)) {
SHM_UNPROTECT();
zend_jit_unprotect();

((zend_op*)opline)->handler =
ZEND_OP_TRACE_INFO(t->opline, jit_extension->offset)->orig_handler;

ZEND_OP_TRACE_INFO(t->opline, jit_extension->offset)->trace_flags &= ~ZEND_JIT_TRACE_JITED;
ZEND_OP_TRACE_INFO(t->opline, jit_extension->offset)->trace_flags |= ZEND_JIT_TRACE_BLACKLISTED;

zend_jit_protect();
SHM_PROTECT();
}
} else {
SHM_UNPROTECT();
zend_jit_unprotect();
Expand Down

0 comments on commit 1f48715

Please sign in to comment.