From 4ddb8feb939f57ea8df1ae9e05f47e26cd031209 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Thu, 19 Nov 2020 13:42:16 +0100 Subject: [PATCH] fixes #15942 [backport:1.2] [backport:1.4] (#16051) (cherry picked from commit 1efd11e2666403fecf1b9b3b933c1adca13d8069) --- compiler/cgen.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/cgen.nim b/compiler/cgen.nim index 9a50b718c7..77fdde3132 100644 --- a/compiler/cgen.nim +++ b/compiler/cgen.nim @@ -244,7 +244,7 @@ proc safeLineNm(info: TLineInfo): int = proc genCLineDir(r: var Rope, filename: string, line: int; conf: ConfigRef) = assert line >= 0 - if optLineDir in conf.options: + if optLineDir in conf.options and line > 0: r.addf("$N#line $2 $1$N", [rope(makeSingleLineCString(filename)), rope(line)])