Merge branch 'PHP-8.4'

* PHP-8.4:
  Fix OSS-Fuzz #403308724
This commit is contained in:
Niels Dossche 2025-03-16 13:45:33 +01:00
commit e4be679780
No known key found for this signature in database
GPG key ID: B8A8AD166DF0E2E5
2 changed files with 32 additions and 2 deletions

View 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"

View file

@ -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;
}
}
/* }}} */