fixes a critical =trace generation bug (see test case) (#14140)

This commit is contained in:
Andreas Rumpf 2020-04-27 22:20:14 +02:00 • committed by GitHub
commit 065a6af2de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 2 deletions

View file

@ -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