Skip to content

Commit

Permalink
fix #27959, regression in location info inside macro expansions
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson committed Jul 7, 2018
1 parent f94ce50 commit 091185f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/julia-syntax.scm
Original file line number Diff line number Diff line change
Expand Up @@ -4078,7 +4078,8 @@ f(x) = yt(x)
(cond ((and (pair? e) (eq? (car e) 'line))
(if (and (= current-line 0) (length= e 2) (pair? linetable))
;; (line n) after push_loc just updates the line for the new file
(set-car! (cdr (car linetable)) (cadr e))
(begin (set-car! (cdr (car linetable)) (cadr e))
(set! current-line (cadr e)))
(begin
(set! current-line (cadr e))
(if (pair? (cddr e))
Expand Down
13 changes: 13 additions & 0 deletions test/backtrace.jl
Original file line number Diff line number Diff line change
Expand Up @@ -164,3 +164,16 @@ let st = stacktrace(bt23971)
@test string(st[1].file) == @__FILE__
@test !occursin("missing", string(st[2].file))
end

# issue #27959
let bt, found = false
@testset begin
bt = backtrace()
end
for frame in map(StackTraces.lookup, bt)
if frame[1].line == @__LINE__() - 3 && frame[1].file == Symbol(@__FILE__)
found = true; break
end
end
@test found
end

0 comments on commit 091185f

Please sign in to comment.