summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2013-09-11 00:00:11 +0200
committerAraq <rumpf_a@web.de>2013-09-11 00:00:11 +0200
commit596496f69589cefd7252d655bc2bb91cd4a74f87 (patch)
treef90b5bc5a76696788cbd52e7bdf12a6e7f66e4fa /compiler
parent4d86b8a83c1d3e485811afd42ff5a7cd02c9daa8 (diff)
downloadNim-596496f69589cefd7252d655bc2bb91cd4a74f87.tar.gz
fixes #566
Diffstat (limited to 'compiler')
-rw-r--r--compiler/semexprs.nim4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim
index dfd054e42..47e07d402 100644
--- a/compiler/semexprs.nim
+++ b/compiler/semexprs.nim
@@ -1021,8 +1021,8 @@ proc semSubscript(c: PContext, n: PNode, flags: TExprFlags): PNode =
   var arr = skipTypes(n.sons[0].typ, {tyGenericInst, tyVar, tyPtr, tyRef})
   case arr.kind
   of tyArray, tyOpenArray, tyVarargs, tyArrayConstr, tySequence, tyString, 
-     tyCString: 
-    checkSonsLen(n, 2)
+     tyCString:
+    if n.len != 2: return nil
     n.sons[0] = makeDeref(n.sons[0])
     for i in countup(1, sonsLen(n) - 1): 
       n.sons[i] = semExprWithType(c, n.sons[i],