summary refs log tree commit diff stats
path: root/lib/system
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2017-01-27 07:06:22 +0100
committerAndreas Rumpf <rumpf_a@web.de>2017-01-27 07:06:22 +0100
commitcb6c975d3a5ac30a8861dcd22329ff5829cad08a (patch)
tree210d4dbf321260d07f80a93ddb13d57326604799 /lib/system
parent8d3d9ce5cc8a7e82482c25c7acc7737410d76f3b (diff)
downloadNim-cb6c975d3a5ac30a8861dcd22329ff5829cad08a.tar.gz
fixes repr regression
Diffstat (limited to 'lib/system')
-rw-r--r--lib/system/repr.nim4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/system/repr.nim b/lib/system/repr.nim
index 04dbe1142..d9aa03b53 100644
--- a/lib/system/repr.nim
+++ b/lib/system/repr.nim
@@ -277,7 +277,9 @@ when not defined(useNimRtl):
     of tyEnum: add result, reprEnum(getInt(p, typ.size), typ)
     of tyBool: add result, reprBool(cast[ptr bool](p)[])
     of tyChar: add result, reprChar(cast[ptr char](p)[])
-    of tyString: reprStrAux(result, cast[ptr string](p)[], cast[ptr string](p)[].len)
+    of tyString:
+      let sp = cast[ptr string](p)
+      reprStrAux(result, if sp[].isNil: nil else: sp[].cstring, sp[].len)
     of tyCString:
       let cs = cast[ptr cstring](p)[]
       if cs.isNil: add result, "nil"