summary refs log tree commit diff stats
path: root/compiler/guards.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2013-07-20 20:18:21 +0200
committerAraq <rumpf_a@web.de>2013-07-20 20:18:21 +0200
commit84534ce4b8d2717f672e870921cab46dc2397c28 (patch)
tree7af128c33e1e40f44d538c2e1ba60e4c026f4770 /compiler/guards.nim
parentaa88e150dac8753dc94da237c2b8d09b2ba7a91d (diff)
parenta932d201d2a0090e3501d9fcf2e38b65f2b0997a (diff)
downloadNim-84534ce4b8d2717f672e870921cab46dc2397c28.tar.gz
Merge branch 'master' of github.com:Araq/Nimrod
Diffstat (limited to 'compiler/guards.nim')
-rw-r--r--compiler/guards.nim3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/guards.nim b/compiler/guards.nim
index d8441c544..8d271fa6d 100644
--- a/compiler/guards.nim
+++ b/compiler/guards.nim
@@ -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)