Skip to content

Commit 1f48715

Browse files
committed
Merge branch 'PHP-8.3'
* PHP-8.3: Fix GH-14475: PHP 8.3.7 with JIT encounters infinite loop on specific paths (#14558)
2 parents 1fc083e + e842ddf commit 1f48715

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

ext/opcache/jit/zend_jit_trace.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8627,7 +8627,20 @@ int ZEND_FASTCALL zend_jit_trace_exit(uint32_t exit_num, zend_jit_registers_buf
86278627
if (!(ZEND_OP_TRACE_INFO(t->opline, jit_extension->offset)->trace_flags & (ZEND_JIT_TRACE_JITED|ZEND_JIT_TRACE_BLACKLISTED))) {
86288628
/* skip: not JIT-ed nor blacklisted */
86298629
} else if (ZEND_JIT_TRACE_NUM >= JIT_G(max_root_traces)) {
8630-
/* skip: too many root traces */
8630+
/* too many root traces, blacklist the root trace */
8631+
if (!(ZEND_OP_TRACE_INFO(t->opline, jit_extension->offset)->trace_flags & ZEND_JIT_TRACE_BLACKLISTED)) {
8632+
SHM_UNPROTECT();
8633+
zend_jit_unprotect();
8634+
8635+
((zend_op*)opline)->handler =
8636+
ZEND_OP_TRACE_INFO(t->opline, jit_extension->offset)->orig_handler;
8637+
8638+
ZEND_OP_TRACE_INFO(t->opline, jit_extension->offset)->trace_flags &= ~ZEND_JIT_TRACE_JITED;
8639+
ZEND_OP_TRACE_INFO(t->opline, jit_extension->offset)->trace_flags |= ZEND_JIT_TRACE_BLACKLISTED;
8640+
8641+
zend_jit_protect();
8642+
SHM_PROTECT();
8643+
}
86318644
} else {
86328645
SHM_UNPROTECT();
86338646
zend_jit_unprotect();

0 commit comments

Comments
 (0)