[php-src] PR #23449: JIT: Fix zend_jit_trace_find_init_fcall_op()
| From: | arnaud-lb | Date: | Tue, 25 Aug 2026 10:50:47 +0000 |
| Subject: | [php-src] PR #23449: JIT: Fix zend_jit_trace_find_init_fcall_op() | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-38126@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/23449
Author: arnaud-lb
zend_jit_trace_find_init_fcall_op() tries to find the INIT_FCALL opline
corresponding to a ZEND_JIT_TRACE_INIT_CALL record, but it fails to do so in the
ZEND_JIT_TRACE_FAKE_INIT_CALL case, for nested calls.
The ZEND_JIT_TRACE_FAKE_INIT_CALL case implies that p points to a sequence
of ZEND_JIT_TRACE_INIT_CALL trace records. The first loop in
zend_jit_trace_find_init_fcall_op() is supposed to find the first opline
after the sequence of ZEND_JIT_TRACE_INIT_CALL record, but it mistakenly decrements
p after initially incrementing it. As a result p eventually points to an
invalid record.
It works for non-nested calls because the p->op == ZEND_JIT_TRACE_VM condition is
true on the first iteration in that case.
This can not lead to a crash or miscompilations, but this results in lost optimization
opportunities.