summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorGrzegorz Adam Hankiewicz <gradha@imap.cc>2013-07-09 23:31:13 +0200
committerGrzegorz Adam Hankiewicz <gradha@imap.cc>2013-07-09 23:31:13 +0200
commit172945de31d152e362636daca3fb968481d96bdb (patch)
tree79a3e8d505b291358f2a3cb13cbb2daba9bf7b47
parentdbb87bc557ef633ad544502d90137a6f55e67dc4 (diff)
downloadNim-172945de31d152e362636daca3fb968481d96bdb.tar.gz
Avoids usefulFact recursion with nil parameter. Fixes #518.
-rw-r--r--compiler/guards.nim3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/guards.nim b/compiler/guards.nim
index f02a53684..c43e918d9 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)
 
ds/account/view.go?id=c6b776adbfb11ba34756a1d4f770b15c2fb3cb46'>^
2a09617 ^


6838c23 ^
2a09617 ^
27b2517 ^

6838c23 ^
27b2517 ^



3cd0d5b ^


27b2517 ^

abd9e78 ^


4966b91 ^
abd9e78 ^
3cd0d5b ^

f3158b3 ^
58db517 ^




f3158b3 ^


27b2517 ^

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51