Skip to content

Commit d26a678

Browse files
committed
Clear cache slots
1 parent bf858a8 commit d26a678

File tree

9 files changed

+13
-1
lines changed

9 files changed

+13
-1
lines changed

ext/date/php_date.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4399,6 +4399,7 @@ static zval *date_interval_get_property_ptr_ptr(zend_object *object, zend_string
43994399
zend_string_equals_literal(name, "days") ||
44004400
zend_string_equals_literal(name, "invert") ) {
44014401
/* Fallback to read_property. */
4402+
cache_slot[0] = cache_slot[1] = cache_slot[2] = NULL;
44024403
ret = NULL;
44034404
} else {
44044405
ret = zend_std_get_property_ptr_ptr(object, name, type, cache_slot);

ext/dom/php_dom.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ static zval *dom_get_property_ptr_ptr(zend_object *object, zend_string *name, in
303303
return zend_std_get_property_ptr_ptr(object, name, type, cache_slot);
304304
}
305305

306+
cache_slot[0] = cache_slot[1] = cache_slot[2] = NULL;
306307
return NULL;
307308
}
308309

ext/pdo/pdo_stmt.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2495,6 +2495,7 @@ static zval *pdo_row_get_property_ptr_ptr(zend_object *object, zend_string *name
24952495
ZEND_IGNORE_VALUE(type);
24962496
ZEND_IGNORE_VALUE(cache_slot);
24972497

2498+
cache_slot[0] = cache_slot[1] = cache_slot[2] = NULL;
24982499
return NULL;
24992500
}
25002501

ext/simplexml/simplexml.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,8 @@ static zval *sxe_property_get_adr(zend_object *object, zend_string *zname, int f
635635
SXE_ITER type;
636636
zval member;
637637

638+
cache_slot[0] = cache_slot[1] = cache_slot[2] = NULL;
639+
638640
sxe = php_sxe_fetch_object(object);
639641
GET_NODE(sxe, node);
640642
if (UNEXPECTED(!node)) {

ext/simplexml/tests/gh17736.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ GH-17736 (Assertion failure zend_reference_destroy())
44
simplexml
55
--FILE--
66
<?php
7-
$o1 = new SimpleXMlElement('<a/>');
7+
$o1 = new SimpleXMLElement('<a/>');
88
class C {
99
public int $a = 1;
1010
}

ext/snmp/snmp.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1861,6 +1861,7 @@ static zval *php_snmp_get_property_ptr_ptr(zend_object *object, zend_string *nam
18611861
return zend_std_get_property_ptr_ptr(object, name, type, cache_slot);
18621862
}
18631863

1864+
cache_slot[0] = cache_slot[1] = cache_slot[2] = NULL;
18641865
return NULL;
18651866
}
18661867

ext/spl/spl_array.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -844,6 +844,8 @@ static zval *spl_array_get_property_ptr_ptr(zend_object *object, zend_string *na
844844

845845
if ((intern->ar_flags & SPL_ARRAY_ARRAY_AS_PROPS) != 0
846846
&& !zend_std_has_property(object, name, ZEND_PROPERTY_EXISTS, NULL)) {
847+
cache_slot[0] = cache_slot[1] = cache_slot[2] = NULL;
848+
847849
/* If object has offsetGet() overridden, then fallback to read_property,
848850
* which will call offsetGet(). */
849851
zval member;

ext/xmlreader/php_xmlreader.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ zval *xmlreader_get_property_ptr_ptr(zend_object *object, zend_string *name, int
121121
zval *retval = NULL;
122122
xmlreader_prop_handler *hnd = NULL;
123123

124+
cache_slot[0] = cache_slot[1] = cache_slot[2] = NULL;
125+
124126
obj = php_xmlreader_fetch_object(object);
125127

126128
if (obj->prop_handler != NULL) {

ext/zip/php_zip.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -890,6 +890,8 @@ static zval *php_zip_get_property_ptr_ptr(zend_object *object, zend_string *name
890890
zval *retval = NULL;
891891
zip_prop_handler *hnd = NULL;
892892

893+
cache_slot[0] = cache_slot[1] = cache_slot[2] = NULL;
894+
893895
obj = php_zip_fetch_object(object);
894896

895897
if (obj->prop_handler != NULL) {

0 commit comments

Comments
 (0)