Skip to content

Commit e3683ea

Browse files
committed
Merge branch 'PHP-8.3'
* PHP-8.3: Prevent recording traces started from usupported VM instruction
2 parents fd47cd8 + 0025995 commit e3683ea

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

ext/opcache/jit/zend_jit_vm_helpers.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,16 @@ zend_jit_trace_stop ZEND_FASTCALL zend_jit_trace_execute(zend_execute_data *ex,
638638
return ZEND_JIT_TRACE_STOP_EXCEPTION;
639639
}
640640

641+
trace_flags = ZEND_OP_TRACE_INFO(opline, offset)->trace_flags;
642+
if (trace_flags & ZEND_JIT_TRACE_UNSUPPORTED) {
643+
TRACE_END(ZEND_JIT_TRACE_END, ZEND_JIT_TRACE_STOP_NOT_SUPPORTED, opline);
644+
#ifdef HAVE_GCC_GLOBAL_REGS
645+
execute_data = save_execute_data;
646+
opline = save_opline;
647+
#endif
648+
return ZEND_JIT_TRACE_STOP_NOT_SUPPORTED;
649+
}
650+
641651
if (prev_call) {
642652
int ret = zend_jit_trace_record_fake_init_call(prev_call, trace_buffer, idx, is_megamorphic);
643653
if (ret < 0) {

0 commit comments

Comments
 (0)