summary refs log tree commit diff stats
path: root/tests/destructor
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2020-04-27 22:20:14 +0200
committerGitHub <noreply@github.com>2020-04-27 22:20:14 +0200
commit065a6af2dea252818bd58af066378ee54be2c3f8 (patch)
tree9536960cae1aeb1337b87bd4888368a2a3bfcf7a /tests/destructor
parent2f1aad02642576d13df018c9e5869c8de7e3a539 (diff)
downloadNim-065a6af2dea252818bd58af066378ee54be2c3f8.tar.gz
fixes a critical =trace generation bug (see test case) (#14140)
Diffstat (limited to 'tests/destructor')
-rw-r--r--tests/destructor/tcycle2.nim16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/destructor/tcycle2.nim b/tests/destructor/tcycle2.nim
index 843c7cf1c..7b03101fe 100644
--- a/tests/destructor/tcycle2.nim
+++ b/tests/destructor/tcycle2.nim
@@ -13,8 +13,24 @@ proc main(x: int) =
   let m = n
   n.kids.add m
 
+type
+  NodeA = ref object
+    s: char
+    a: array[3, NodeA]
+
+proc m: NodeA =
+  result = NodeA(s: 'a')
+  result.a[0] = result
+  result.a[1] = result
+  result.a[2] = result
+
+proc mainA =
+  for i in 0..10:
+    discard m()
+
 let mem = getOccupiedMem()
 main(90)
+mainA()
 GC_fullCollect()
 
 echo "MEM ", getOccupiedMem() - mem