mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
- MFH Fix issue with destruction of overloaded objects
This commit is contained in:
parent
0edbdd7680
commit
ce2f9bb0cf
4 changed files with 24 additions and 9 deletions
|
@ -53,6 +53,7 @@ ZEND_API void zend_objects_destroy_object(zend_object *object, zend_object_handl
|
|||
|
||||
if (destructor) {
|
||||
zval *obj;
|
||||
zend_object_store_bucket *obj_bucket;
|
||||
|
||||
if (destructor->op_array.fn_flags & (ZEND_ACC_PRIVATE|ZEND_ACC_PROTECTED)) {
|
||||
if (destructor->op_array.fn_flags & ZEND_ACC_PRIVATE) {
|
||||
|
@ -87,8 +88,11 @@ ZEND_API void zend_objects_destroy_object(zend_object *object, zend_object_handl
|
|||
MAKE_STD_ZVAL(obj);
|
||||
Z_TYPE_P(obj) = IS_OBJECT;
|
||||
Z_OBJ_HANDLE_P(obj) = handle;
|
||||
/* TODO: We cannot set proper handlers. */
|
||||
Z_OBJ_HT_P(obj) = &std_object_handlers;
|
||||
obj_bucket = &EG(objects_store).object_buckets[handle];
|
||||
if (!obj_bucket->bucket.obj.handlers) {
|
||||
obj_bucket->bucket.obj.handlers = &std_object_handlers;
|
||||
}
|
||||
Z_OBJ_HT_P(obj) = obj_bucket->bucket.obj.handlers;
|
||||
zval_copy_ctor(obj);
|
||||
|
||||
/* Make sure that destructors are protected from previously thrown exceptions.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue