mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Fix bug #69448
ReflectionClass::newInstanceWithoutConstructor should not call object_init_ex when the class is internal and final. This is because the class dtor may rely on the ctor being called and in some cases this will cause a segfault.
This commit is contained in:
parent
8dfb35eae0
commit
dad622bf42
1 changed files with 1 additions and 0 deletions
|
@ -4315,6 +4315,7 @@ ZEND_METHOD(reflection_class, newInstanceWithoutConstructor)
|
|||
|
||||
if (ce->create_object != NULL && ce->ce_flags & ZEND_ACC_FINAL) {
|
||||
zend_throw_exception_ex(reflection_exception_ptr, 0, "Class %s is an internal class marked as final that cannot be instantiated without invoking its constructor", ce->name->val);
|
||||
return;
|
||||
}
|
||||
|
||||
object_init_ex(return_value, ce);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue