File tree 2 files changed +20
-2
lines changed
2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -3030,12 +3030,12 @@ static zend_always_inline zend_result _zend_update_type_info(
3030
3030
case ZEND_ASSIGN_OBJ :
3031
3031
if (opline -> op1_type == IS_CV ) {
3032
3032
zend_class_entry * ce = ssa_var_info [ssa_op -> op1_use ].ce ;
3033
- bool add_rc = !ce
3033
+ bool add_rc = ( t1 & ( MAY_BE_OBJECT | MAY_BE_REF )) && ( !ce
3034
3034
|| ce -> __set
3035
3035
/* Non-default write_property may be set within create_object. */
3036
3036
|| ce -> create_object
3037
3037
|| ce -> default_object_handlers -> write_property != zend_std_write_property
3038
- || ssa_var_info [ssa_op -> op1_use ].is_instanceof ;
3038
+ || ssa_var_info [ssa_op -> op1_use ].is_instanceof ) ;
3039
3039
tmp = (t1 & (MAY_BE_REF |MAY_BE_OBJECT |MAY_BE_RC1 |MAY_BE_RCN ))|(add_rc ? (MAY_BE_RC1 |MAY_BE_RCN ) : 0 );
3040
3040
UPDATE_SSA_TYPE (tmp , ssa_op -> op1_def );
3041
3041
COPY_SSA_OBJ_TYPE (ssa_op -> op1_use , ssa_op -> op1_def );
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ oss-fuzz #66519: Fix RC inference narrowing for ASSIGN_OBJ
3
+ --EXTENSIONS--
4
+ opcache
5
+ --INI--
6
+ opcache.enable_cli=1
7
+ --FILE--
8
+ <?php
9
+ function test () {
10
+ for (;;) {
11
+ [] ?? $ oj ->y = y;
12
+ $ oj = new stdClass ;
13
+ }
14
+ }
15
+ ?>
16
+ ===DONE===
17
+ --EXPECT--
18
+ ===DONE===
You can’t perform that action at this time.
0 commit comments