[php-src] PR #24598: Load DECLARE_LAMBDA_FUNCTION cache slot once
| From: | Leiyks | Date: | Fri, 23 Oct 2026 11:43:33 +0000 |
| Subject: | [php-src] PR #24598: Load DECLARE_LAMBDA_FUNCTION cache slot once | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-39762@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/24598
Author: Leiyks
ZEND_DECLARE_LAMBDA_FUNCTION and ZEND_CALLABLE_CONVERT check
opline->extended_value != (uint32_t)-1 and then read it again for
CACHED_PTR/CACHE_PTR. This reads it once into a local.
An extension can turn off the closure cache for a single declaration by setting
extended_value to -1 (dd-trace-php does this so per-instance hooks don't end up on
a shared closure). With opcache that write is in shared memory, and on builds that emit the second
load (debug builds, or -fno-strict-aliasing as used by Debian and Fedora packages)
another process can pass the check and then use -1 as the slot offset.