summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2017-03-07 13:17:33 +0100
committerNikita Popov <nikita.ppv@gmail.com>2017-03-07 13:17:33 +0100
commit8a6281455ed41ec42af2ceeeb789835b41839135 (patch)
treec5a974950a8d900b690ea0ee71108985aa7e0a2c
parentd9231b16670cd450544cb0f050c72af9809e47e7 (diff)
parent549a30d2cd7756abc5f5116dfebe217098ade5c5 (diff)
downloadphp-git-8a6281455ed41ec42af2ceeeb789835b41839135.tar.gz
Merge branch 'PHP-7.0' into PHP-7.1
-rw-r--r--Zend/zend_gc.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/Zend/zend_gc.c b/Zend/zend_gc.c
index 087f04bc3f..64d1766c1c 100644
--- a/Zend/zend_gc.c
+++ b/Zend/zend_gc.c
@@ -325,9 +325,12 @@ static zend_always_inline gc_root_buffer* gc_find_additional_buffer(zend_refcoun
/* We have to check each additional_buffer to find which one holds the ref */
while (additional_buffer) {
- gc_root_buffer *root = additional_buffer->buf + (GC_ADDRESS(GC_INFO(ref)) - GC_ROOT_BUFFER_MAX_ENTRIES);
- if (root->ref == ref) {
- return root;
+ uint32_t idx = GC_ADDRESS(GC_INFO(ref)) - GC_ROOT_BUFFER_MAX_ENTRIES;
+ if (idx < additional_buffer->used) {
+ gc_root_buffer *root = additional_buffer->buf + idx;
+ if (root->ref == ref) {
+ return root;
+ }
}
additional_buffer = additional_buffer->next;
}