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

This commit is contained in:
Andreas Rumpf 2020-11-15 15:47:42 +01:00 • committed by GitHub
commit 7eb34d170a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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()