mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-30 01:44:37 +00:00
Avoids usefulFact recursion with nil parameter. Fixes #518.
This commit is contained in:
@@ -187,7 +187,8 @@ proc usefulFact(n: PNode): PNode =
|
||||
# if a:
|
||||
# ...
|
||||
# We make can easily replace 'a' by '2 < x' here:
|
||||
result = usefulFact(n.sym.ast)
|
||||
if n.sym.ast != nil:
|
||||
result = usefulFact(n.sym.ast)
|
||||
elif n.kind == nkStmtListExpr:
|
||||
result = usefulFact(n.lastSon)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user