We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 648b756 commit 549a30dCopy full SHA for 549a30d
Zend/zend_gc.c
@@ -275,9 +275,12 @@ static zend_always_inline gc_root_buffer* gc_find_additional_buffer(zend_refcoun
275
276
/* We have to check each additional_buffer to find which one holds the ref */
277
while (additional_buffer) {
278
- gc_root_buffer *root = additional_buffer->buf + (GC_ADDRESS(GC_INFO(ref)) - GC_ROOT_BUFFER_MAX_ENTRIES);
279
- if (root->ref == ref) {
280
- 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;
281
+ if (root->ref == ref) {
282
+ return root;
283
+ }
284
}
285
additional_buffer = additional_buffer->next;
286
0 commit comments