From 9485f1c888422bc39f6f6b0e06e5dc230636be06 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Mon, 16 Oct 2017 20:29:16 +0200 Subject: make tests green again --- compiler/ccgexprs.nim | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'compiler/ccgexprs.nim') diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim index 008599727..12e457e90 100644 --- a/compiler/ccgexprs.nim +++ b/compiler/ccgexprs.nim @@ -978,9 +978,12 @@ proc genEcho(p: BProc, n: PNode) = p.module.includeHeader("") linefmt(p, cpsStmts, """Genode::log(""$1);$n""", args) else: - var a: TLoc - initLocExpr(p, n, a) - linefmt(p, cpsStmts, "#echoBinSafe($1, $2);$n", a.rdLoc, n.len.rope) + if n.len == 0: + linefmt(p, cpsStmts, "#echoBinSafe(NIM_NIL, $1);$n", n.len.rope) + else: + var a: TLoc + initLocExpr(p, n, a) + linefmt(p, cpsStmts, "#echoBinSafe($1, $2);$n", a.rdLoc, n.len.rope) when false: p.module.includeHeader("") linefmt(p, cpsStmts, "printf($1$2);$n", -- cgit 1.4.1-2-gfad0