diff options
-rw-r--r-- | compiler/semexprs.nim | 4 |
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], |