diff --git a/src/refcount.c b/src/refcount.c index 841a163..8588649 100644 --- a/src/refcount.c +++ b/src/refcount.c @@ -653,12 +653,11 @@ static ptrdiff_t check_gc_root(RefcountContext *ctx, RefcountList **root_ptr) { // future) while (queue) { void *obj = queue->data; + queue = refcount_list_pop_full(queue, NULL, &ctx->alloc); if (!obj || refcount_context_is_static(ctx, obj)) { - queue = refcount_list_pop_full(queue, NULL, &ctx->alloc); continue; } uintptr_t count; - queue = refcount_list_pop_full(queue, NULL, &ctx->alloc); if (ht_has(counts, obj)) { count = HT_UUNSTUFF(ht_get(counts, obj)); } else {