Skip to content

Commit e4be679

Browse files
committedMar 16, 2025
Merge branch 'PHP-8.4'
* PHP-8.4: Fix OSS-Fuzz #403308724
2 parents d8e7f36 + 4fd9992 commit e4be679

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
--TEST--
2+
OSS-Fuzz #403308724
3+
--FILE--
4+
<?php
5+
class Base {
6+
public $y { get => 1; }
7+
}
8+
9+
class Test extends Base {
10+
public $y {
11+
get => [new class {
12+
public $inner {get => __PROPERTY__;}
13+
}, parent::$y::get()];
14+
}
15+
}
16+
17+
$test = new Test;
18+
$y = $test->y;
19+
var_dump($y);
20+
var_dump($y[0]->inner);
21+
?>
22+
--EXPECT--
23+
array(2) {
24+
[0]=>
25+
object(class@anonymous)#2 (0) {
26+
}
27+
[1]=>
28+
int(1)
29+
}
30+
string(5) "inner"

‎Zend/zend_compile.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -8686,7 +8686,7 @@ static void zend_compile_prop_decl(zend_ast *ast, zend_ast *type_ast, uint32_t f
86868686
zend_type type = ZEND_TYPE_INIT_NONE(0);
86878687
flags |= zend_property_is_virtual(ce, name, hooks_ast, flags) ? ZEND_ACC_VIRTUAL : 0;
86888688

8689-
ZEND_ASSERT(!CG(context).active_property_info_name);
8689+
zend_string *old_active_property_info_name = CG(context).active_property_info_name;
86908690
CG(context).active_property_info_name = name;
86918691

86928692
if (!hooks_ast) {
@@ -8782,7 +8782,7 @@ static void zend_compile_prop_decl(zend_ast *ast, zend_ast *type_ast, uint32_t f
87828782
zend_compile_attributes(&info->attributes, attr_ast, 0, ZEND_ATTRIBUTE_TARGET_PROPERTY, 0);
87838783
}
87848784

8785-
CG(context).active_property_info_name = NULL;
8785+
CG(context).active_property_info_name = old_active_property_info_name;
87868786
}
87878787
}
87888788
/* }}} */

0 commit comments

Comments
 (0)
Failed to load comments.