Skip to content

Commit 67318e9

Browse files
committed
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
1 parent 6056217 commit 67318e9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Zend/zend_execute.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3615,8 +3615,8 @@ static zend_always_inline zend_result zend_fetch_static_property_address(zval **
36153615
if (opline->op1_type == IS_CONST
36163616
&& (opline->op2_type == IS_CONST
36173617
|| (opline->op2_type == IS_UNUSED
3618-
&& (opline->op2.num == ZEND_FETCH_CLASS_SELF
3619-
|| opline->op2.num == ZEND_FETCH_CLASS_PARENT)))
3618+
&& ((opline->op2.num & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_SELF
3619+
|| (opline->op2.num & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_PARENT)))
36203620
&& EXPECTED(CACHED_PTR(cache_slot) != NULL)) {
36213621
*retval = CACHED_PTR(cache_slot + sizeof(void *));
36223622
property_info = CACHED_PTR(cache_slot + sizeof(void *) * 2);

0 commit comments

Comments
 (0)