fixes #15753 [backport:1.4] (#15971)

(cherry picked from commit 7eb34d170a)
This commit is contained in:
Andreas Rumpf
2020-11-15 15:47:42 +01:00
committed by narimiran
parent f02b359968
commit fffb0dbea5
2 changed files with 109 additions and 19 deletions

View File

@@ -0,0 +1,33 @@
discard """
output: '''ok'''
cmd: '''nim c --gc:orc -d:useMalloc -d:nimStressOrc $file'''
valgrind: "leaks"
"""
# bug #15753
type
NodeKind = enum
nkDancing,
nkColumn
DancingNode = ref object
right: DancingNode
column: DancingNode
kind: NodeKind
proc newColumnNode(): DancingNode =
result = DancingNode(kind: nkColumn)
result.right = result
result.column = result
proc createDLXList(): DancingNode =
result = newColumnNode()
for i in 0 .. 15:
let n = newColumnNode()
n.right = result.right
result = n
echo "ok"
var dlxlist = createDLXList()