1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

zend_objects: Remove unnecessary refcounting when calling __clone() (#19145)

Found as part of the clone-with review in php/php-src#18747.
This commit is contained in:
Tim Düsterhus
2025-07-16 18:53:04 +02:00
committed by GitHub
parent 62742996f8
commit 2e0c011fb8

View File

@@ -264,7 +264,6 @@ ZEND_API void ZEND_FASTCALL zend_objects_clone_members(zend_object *new_object,
}
if (has_clone_method) {
GC_ADDREF(new_object);
zend_call_known_instance_method_with_0_params(new_object->ce->clone, new_object, NULL);
if (ZEND_CLASS_HAS_READONLY_PROPS(new_object->ce)) {
@@ -274,8 +273,6 @@ ZEND_API void ZEND_FASTCALL zend_objects_clone_members(zend_object *new_object,
Z_PROP_FLAG_P(prop) &= ~IS_PROP_REINITABLE;
}
}
OBJ_RELEASE(new_object);
}
}