[php-src] PR #22459: JIT: Fix run_time_cache offset stored without map_ptr dereference
| From: | iliaal | Date: | Thu, 25 Jun 2026 22:33:13 +0000 |
| Subject: | [php-src] PR #22459: JIT: Fix run_time_cache offset stored without map_ptr dereference | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-36649@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/22459
Author: iliaal
The tracing JIT could store a raw zend_map_ptr offset into EX(run_time_cache) for a polymorphic
dynamic call (
$callable(...)) that resolves to a non-closure function or method, so the
interpreter dereferenced a bogus address on the next cached lookup. The codegen took the closure
direct-pointer shortcut based on TRACE_FRAME_IS_CLOSURE_CALL, but that flag is set for every
ZEND_INIT_DYNAMIC_CALL regardless of the resolved callee.
Restricting the shortcut to statically-known closures is safe: an invoked closure object always
carries a resolved direct run_time_cache pointer (zend_closures.c), even when its persistent
template is offset-tagged under opcache SHM or file_cache. Regression from 6872432adf1.