From b59c657be3e9049f936c0c6cc6083a41a343737a Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Sat, 10 Dec 2022 16:21:43 +0100 Subject: [PATCH] fixes #21062 (#21068) --- lib/system/alloc.nim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/system/alloc.nim b/lib/system/alloc.nim index 9c8f70c11224..a7db3704bbaf 100644 --- a/lib/system/alloc.nim +++ b/lib/system/alloc.nim @@ -787,8 +787,9 @@ when defined(gcDestructors): while it != nil: if maxIters == 0: let rest = it.next.loada - it.next.storea nil - addToSharedFreeList(c, rest) + if rest != nil: + it.next.storea nil + addToSharedFreeList(c, rest) break inc x, size it = it.next.loada