summary refs log tree commit diff stats
path: root/compiler/cgen.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2018-06-11 23:39:27 +0200
committerGitHub <noreply@github.com>2018-06-11 23:39:27 +0200
commit1c58f31a71d2fb8c8569a6ceb6fffc4778d1c7ab (patch)
treea5f698b1bad62fddcfe832c9651b4916717d038f /compiler/cgen.nim
parentac0f9860081ce20cd1ce1f823db7361ad284b1be (diff)
parent8f067634919eeb232ee04f759c4c1786ddd26ea6 (diff)
downloadNim-1c58f31a71d2fb8c8569a6ceb6fffc4778d1c7ab.tar.gz
Merge pull request #8014 from yglukhov/fix-6803
Fixes #6803
Diffstat (limited to 'compiler/cgen.nim')
-rw-r--r--compiler/cgen.nim21
1 files changed, 8 insertions, 13 deletions
diff --git a/compiler/cgen.nim b/compiler/cgen.nim
index ee60e62d2..cd344f096 100644
--- a/compiler/cgen.nim
+++ b/compiler/cgen.nim
@@ -204,27 +204,22 @@ proc freshLineInfo(p: BProc; info: TLineInfo): bool =
     result = true
 
 proc genLineDir(p: BProc, t: PNode) =
-  var tt = t
-  #while tt.kind in {nkStmtListExpr}+nkCallKinds:
-  #  tt = tt.lastSon
-  if tt.kind in nkCallKinds and tt.len > 1:
-    tt = tt.sons[1]
-  let line = tt.info.safeLineNm
+  let line = t.info.safeLineNm
 
   if optEmbedOrigSrc in p.config.globalOptions:
-    add(p.s(cpsStmts), ~"//" & sourceLine(p.config, tt.info) & "\L")
-  genCLineDir(p.s(cpsStmts), toFullPath(p.config, tt.info), line, p.config)
+    add(p.s(cpsStmts), ~"//" & sourceLine(p.config, t.info) & "\L")
+  genCLineDir(p.s(cpsStmts), toFullPath(p.config, t.info), line, p.config)
   if ({optStackTrace, optEndb} * p.options == {optStackTrace, optEndb}) and
       (p.prc == nil or sfPure notin p.prc.flags):
-    if freshLineInfo(p, tt.info):
+    if freshLineInfo(p, t.info):
       linefmt(p, cpsStmts, "#endb($1, $2);$N",
-              line.rope, makeCString(toFilename(p.config, tt.info)))
+              line.rope, makeCString(toFilename(p.config, t.info)))
   elif ({optLineTrace, optStackTrace} * p.options ==
       {optLineTrace, optStackTrace}) and
-      (p.prc == nil or sfPure notin p.prc.flags) and tt.info.fileIndex != InvalidFileIDX:
-    if freshLineInfo(p, tt.info):
+      (p.prc == nil or sfPure notin p.prc.flags) and t.info.fileIndex != InvalidFileIDX:
+    if freshLineInfo(p, t.info):
       linefmt(p, cpsStmts, "nimln_($1, $2);$n",
-              line.rope, quotedFilename(p.config, tt.info))
+              line.rope, quotedFilename(p.config, t.info))
 
 proc postStmtActions(p: BProc) {.inline.} =
   add(p.s(cpsStmts), p.module.injectStmt)