[php-src] master: Zend: Use pointer hash lookup for property guards
Weilin Du <[email protected]>
| Newsgroups | gmane.comp.php.cvs.general |
|---|---|
| Message-ID | <[email protected]> |
Author: Weilin Du (LamentXU123)
Date: 2026-08-16T16:35:06+08:00
Commit: https://github.com/php/php-src/commit/62e870868dec115423cc6750d7e4f7c8df96027a
Raw diff: https://github.com/php/php-src/commit/62e870868dec115423cc6750d7e4f7c8df96027a.diff
Zend: Use pointer hash lookup for property guards
Changed paths:
M Zend/zend_object_handlers.c
Diff:
diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c
index 95046d1589d4..c5ec6fe5515b 100644
--- a/Zend/zend_object_handlers.c
+++ b/Zend/zend_object_handlers.c
@@ -635,9 +635,9 @@ ZEND_API uint32_t *zend_get_property_guard(zend_object *zobj, zend_string *membe
} else if (EXPECTED(Z_TYPE_P(zv) == IS_ARRAY)) {
guards = Z_ARRVAL_P(zv);
ZEND_ASSERT(guards != NULL);
- zv = zend_hash_find(guards, member);
- if (zv != NULL) {
- return (uint32_t*)(((uintptr_t)Z_PTR_P(zv)) & ~1);
+ void *guard = zend_hash_find_ptr(guards, member);
+ if (guard != NULL) {
+ return (uint32_t*)(((uintptr_t)guard) & ~1);
}
} else {
ZEND_ASSERT(Z_TYPE_P(zv) == IS_UNDEF);