From cb6c975d3a5ac30a8861dcd22329ff5829cad08a Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Fri, 27 Jan 2017 07:06:22 +0100 Subject: [PATCH] fixes repr regression --- lib/system/repr.nim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/system/repr.nim b/lib/system/repr.nim index 04dbe1142d..d9aa03b535 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"