[php-src] master: standard: use new zend_object_copy() API
| From: | Gina Peter Banyard | Date: | Thu, 01 Oct 2026 11:44:28 +0000 |
| Subject: | [php-src] master: standard: use new zend_object_copy() API | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-141826@lists.php.net to get a copy of this message | ||
Author: Gina Peter Banyard (Girgias)
Date: 2026-10-01T12:43:57+01:00
Commit: https://github.com/php/php-src/commit/0806cabd0552abfa329b0ab88d96684b691c2bde
Raw diff: https://github.com/php/php-src/commit/0806cabd0552abfa329b0ab88d96684b691c2bde.diff
standard: use new zend_object_copy() API
Changed paths:
M ext/standard/assert.c
M ext/standard/io_poll.c
Diff:
diff --git a/ext/standard/assert.c b/ext/standard/assert.c
index 618f69a2cf74..f63ab7f8b339 100644
--- a/ext/standard/assert.c
+++ b/ext/standard/assert.c
@@ -195,8 +195,7 @@ PHP_FUNCTION(assert)
}
if (description_obj) {
- GC_ADDREF(description_obj);
- zend_throw_exception_internal(description_obj);
+ zend_throw_exception_internal(zend_object_copy(description_obj));
RETURN_THROWS();
}
diff --git a/ext/standard/io_poll.c b/ext/standard/io_poll.c
index dd0b27ae0067..fd20426668d2 100644
--- a/ext/standard/io_poll.c
+++ b/ext/standard/io_poll.c
@@ -834,8 +834,7 @@ PHP_METHOD(Io_Poll_Context, add)
/* Store in our watchers map */
zval watcher_zv;
- ZVAL_OBJ(&watcher_zv, &watcher->std);
- GC_ADDREF(&watcher->std);
+ ZVAL_OBJ_COPY(&watcher_zv, &watcher->std);
zend_hash_index_add_new(intern->watchers, (zend_ulong) fd, &watcher_zv);
watcher->active = true;
@@ -907,11 +906,7 @@ PHP_METHOD(Io_Poll_Context, wait)
if (watcher) {
watcher->triggered_events = events[i].revents;
- zval watcher_zv;
- ZVAL_OBJ(&watcher_zv, &watcher->std);
- GC_ADDREF(&watcher->std);
-
- add_next_index_zval(return_value, &watcher_zv);
+ add_next_index_object(return_value, zend_object_copy(&watcher->std));
}
}