mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
commit
e4be679780
2 changed files with 32 additions and 2 deletions
30
Zend/tests/property_hooks/oss_fuzz_403308724.phpt
Normal file
30
Zend/tests/property_hooks/oss_fuzz_403308724.phpt
Normal file
|
@ -0,0 +1,30 @@
|
|||
--TEST--
|
||||
OSS-Fuzz #403308724
|
||||
--FILE--
|
||||
<?php
|
||||
class Base {
|
||||
public $y { get => 1; }
|
||||
}
|
||||
|
||||
class Test extends Base {
|
||||
public $y {
|
||||
get => [new class {
|
||||
public $inner {get => __PROPERTY__;}
|
||||
}, parent::$y::get()];
|
||||
}
|
||||
}
|
||||
|
||||
$test = new Test;
|
||||
$y = $test->y;
|
||||
var_dump($y);
|
||||
var_dump($y[0]->inner);
|
||||
?>
|
||||
--EXPECT--
|
||||
array(2) {
|
||||
[0]=>
|
||||
object(class@anonymous)#2 (0) {
|
||||
}
|
||||
[1]=>
|
||||
int(1)
|
||||
}
|
||||
string(5) "inner"
|
|
@ -8686,7 +8686,7 @@ static void zend_compile_prop_decl(zend_ast *ast, zend_ast *type_ast, uint32_t f
|
|||
zend_type type = ZEND_TYPE_INIT_NONE(0);
|
||||
flags |= zend_property_is_virtual(ce, name, hooks_ast, flags) ? ZEND_ACC_VIRTUAL : 0;
|
||||
|
||||
ZEND_ASSERT(!CG(context).active_property_info_name);
|
||||
zend_string *old_active_property_info_name = CG(context).active_property_info_name;
|
||||
CG(context).active_property_info_name = name;
|
||||
|
||||
if (!hooks_ast) {
|
||||
|
@ -8782,7 +8782,7 @@ static void zend_compile_prop_decl(zend_ast *ast, zend_ast *type_ast, uint32_t f
|
|||
zend_compile_attributes(&info->attributes, attr_ast, 0, ZEND_ATTRIBUTE_TARGET_PROPERTY, 0);
|
||||
}
|
||||
|
||||
CG(context).active_property_info_name = NULL;
|
||||
CG(context).active_property_info_name = old_active_property_info_name;
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue