diff --git a/src/libcore/gc.rs b/src/libcore/gc.rs index 697c6fcdfb4..741fa4de122 100644 --- a/src/libcore/gc.rs +++ b/src/libcore/gc.rs @@ -113,7 +113,8 @@ unsafe fn walk_gc_roots(mem: Memory, visitor: Visitor) { let refcount = **root; if mem | task_local_heap != 0 && refcount != -1 { if !visitor(root, tydesc) { return; } - } else if mem | exchange_heap != 0 { + } else if mem | exchange_heap != 0 + && refcount == -1 { if !visitor(root, tydesc) { return; } } } else {