Avoids usefulFact recursion with nil parameter. Fixes #518.
This commit is contained in:
parent
dbb87bc557
commit
172945de31
1 changed files with 2 additions and 1 deletions
|
|
@ -187,6 +187,7 @@ proc usefulFact(n: PNode): PNode =
|
||||||
# if a:
|
# if a:
|
||||||
# ...
|
# ...
|
||||||
# We make can easily replace 'a' by '2 < x' here:
|
# We make can easily replace 'a' by '2 < x' here:
|
||||||
|
if n.sym.ast != nil:
|
||||||
result = usefulFact(n.sym.ast)
|
result = usefulFact(n.sym.ast)
|
||||||
elif n.kind == nkStmtListExpr:
|
elif n.kind == nkStmtListExpr:
|
||||||
result = usefulFact(n.lastSon)
|
result = usefulFact(n.lastSon)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue