File tree Expand file tree Collapse file tree 3 files changed +19
-1
lines changed Expand file tree Collapse file tree 3 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -3262,6 +3262,7 @@ ZEND_API void ZEND_FASTCALL zend_ref_del_type_source(zend_property_info_source_l
3262
3262
zend_property_info_list * list = ZEND_PROPERTY_INFO_SOURCE_TO_LIST (source_list -> list );
3263
3263
zend_property_info * * ptr , * * end ;
3264
3264
3265
+ ZEND_ASSERT (prop );
3265
3266
if (!ZEND_PROPERTY_INFO_SOURCE_IS_LIST (source_list -> list )) {
3266
3267
ZEND_ASSERT (source_list -> ptr == prop );
3267
3268
source_list -> ptr = NULL ;
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Overwrite reference in untyped property
3
+ --FILE--
4
+ <?php
5
+ class Test {
6
+ public $ prop ;
7
+ }
8
+ $ s = <<<'STR'
9
+ O:4:"Test":2:{s:4:"prop";R:1;s:4:"prop";i:0;}
10
+ STR;
11
+ var_dump (unserialize ($ s ));
12
+ ?>
13
+ --EXPECT--
14
+ object(Test)#1 (1) {
15
+ ["prop"]=>
16
+ int(0)
17
+ }
Original file line number Diff line number Diff line change @@ -556,7 +556,7 @@ string_key:
556
556
/* This is a property with a declaration */
557
557
old_data = Z_INDIRECT_P (old_data);
558
558
info = zend_get_typed_property_info_for_slot (obj, old_data);
559
- if (Z_ISREF_P (old_data)) {
559
+ if (info && Z_ISREF_P (old_data)) {
560
560
/* If the value is overwritten, remove old type source from ref. */
561
561
ZEND_REF_DEL_TYPE_SOURCE (Z_REF_P (old_data), info);
562
562
}
You can’t perform that action at this time.
0 commit comments