Skip to content

Commit 2e7332b

Browse files
committed
zend_objects: Remove unnecessary refcounting when calling __clone()
Found as part of the clone-with review in php#18747.
1 parent 02b9455 commit 2e7332b

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

Zend/zend_objects.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,6 @@ ZEND_API void ZEND_FASTCALL zend_objects_clone_members(zend_object *new_object,
264264
}
265265

266266
if (has_clone_method) {
267-
GC_ADDREF(new_object);
268267
zend_call_known_instance_method_with_0_params(new_object->ce->clone, new_object, NULL);
269268

270269
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,
274273
Z_PROP_FLAG_P(prop) &= ~IS_PROP_REINITABLE;
275274
}
276275
}
277-
278-
OBJ_RELEASE(new_object);
279276
}
280277
}
281278

0 commit comments

Comments
 (0)