Fix op2 caching for static properties

op2.num may contain other flags, like ZEND_FETCH_CLASS_EXCEPTION. These
currently circumvent caching. Once the property is cached, these flags have no
influence on the result, so it doesn't seem like this was done on purpose.

Closes GH-16380
This commit is contained in:
Ilija Tovilo 2024-10-11 23:48:33 +02:00
parent 60562175ed
commit 67318e91bc
No known key found for this signature in database
GPG Key ID: 5050C66BFCD1015A

View File

@ -3615,8 +3615,8 @@ static zend_always_inline zend_result zend_fetch_static_property_address(zval **
if (opline->op1_type == IS_CONST
&& (opline->op2_type == IS_CONST
|| (opline->op2_type == IS_UNUSED
&& (opline->op2.num == ZEND_FETCH_CLASS_SELF
|| opline->op2.num == ZEND_FETCH_CLASS_PARENT)))
&& ((opline->op2.num & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_SELF
|| (opline->op2.num & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_PARENT)))
&& EXPECTED(CACHED_PTR(cache_slot) != NULL)) {
*retval = CACHED_PTR(cache_slot + sizeof(void *));
property_info = CACHED_PTR(cache_slot + sizeof(void *) * 2);