summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorSimon Hafner <hafnersimon@gmail.com>2015-01-29 04:40:27 -0600
committerSimon Hafner <hafnersimon@gmail.com>2015-01-29 04:40:27 -0600
commit5ecc461a944b54a516e6f81df4bd6db95a86e682 (patch)
tree706670ce28a23487be512b91c7a40ff044646026 /compiler
parentd4786976dd80ad7aef531b259cf04ab65e80dabc (diff)
downloadNim-5ecc461a944b54a516e6f81df4bd6db95a86e682.tar.gz
Fixes #2030
Diffstat (limited to 'compiler')
-rw-r--r--compiler/semexprs.nim2
-rw-r--r--compiler/semfold.nim4
2 files changed, 3 insertions, 3 deletions
diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim
index 6638848df..34a9cd1dd 100644
--- a/compiler/semexprs.nim
+++ b/compiler/semexprs.nim
@@ -306,7 +306,7 @@ proc semLowHigh(c: PContext, n: PNode, m: TMagic): PNode =
     var typ = skipTypes(n.sons[1].typ, abstractVarRange +
                                        {tyTypeDesc, tyFieldAccessor})
     case typ.kind
-    of tySequence, tyString, tyOpenArray, tyVarargs: 
+    of tySequence, tyString, tyCString, tyOpenArray, tyVarargs: 
       n.typ = getSysType(tyInt)
     of tyArrayConstr, tyArray: 
       n.typ = typ.sons[0] # indextype
diff --git a/compiler/semfold.nim b/compiler/semfold.nim
index 1988c512e..a3f1b1c13 100644
--- a/compiler/semfold.nim
+++ b/compiler/semfold.nim
@@ -665,8 +665,8 @@ proc getConstExpr(m: PSym, n: PNode): PNode =
       of mLow: 
         result = newIntNodeT(firstOrd(n.sons[1].typ), n)
       of mHigh: 
-        if  skipTypes(n.sons[1].typ, abstractVar).kind notin
-            {tyOpenArray, tyVarargs, tySequence, tyString}:
+        if skipTypes(n.sons[1].typ, abstractVar).kind notin
+            {tySequence, tyString, tyCString, tyOpenArray, tyVarargs}:
           result = newIntNodeT(lastOrd(skipTypes(n[1].typ, abstractVar)), n)
         else:
           var a = getArrayConstr(m, n.sons[1])