summary refs log tree commit diff stats
path: root/compiler/sempass2.nim
diff options
context:
space:
mode:
authorZahary Karadjov <zahary@gmail.com>2013-01-27 23:41:45 +0200
committerZahary Karadjov <zahary@gmail.com>2013-01-27 23:41:45 +0200
commit81a3585872b1a327b62ba528addbee913d6bbe5a (patch)
treeaff8358bc86704edbd89fd56ec4f7b0cd3583bca /compiler/sempass2.nim
parent67f37264b3f461fe46f5cfea7c35c0a4f709dcb0 (diff)
parent07585088955c1fe8fb815c40409ed9f5d66fd446 (diff)
downloadNim-81a3585872b1a327b62ba528addbee913d6bbe5a.tar.gz
merged upstream master
Diffstat (limited to 'compiler/sempass2.nim')
-rw-r--r--compiler/sempass2.nim9
1 files changed, 6 insertions, 3 deletions
diff --git a/compiler/sempass2.nim b/compiler/sempass2.nim
index bd8a3ba02..b2fd0fb04 100644
--- a/compiler/sempass2.nim
+++ b/compiler/sempass2.nim
@@ -1,7 +1,7 @@
 #
 #
 #           The Nimrod Compiler
-#        (c) Copyright 2012 Andreas Rumpf
+#        (c) Copyright 2013 Andreas Rumpf
 #
 #    See the file "copying.txt", included in this
 #    distribution, for details about the copyright.
@@ -146,8 +146,11 @@ proc catches(tracked: PEffects, e: PType) =
       dec L
     else:
       inc i
-  setLen(tracked.exc.sons, L)
-  
+  if not isNil(tracked.exc.sons):
+    setLen(tracked.exc.sons, L)
+  else:
+    assert L == 0
+
 proc catchesAll(tracked: PEffects) =
   if not isNil(tracked.exc.sons):
     setLen(tracked.exc.sons, tracked.bottom)