Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing LineNumberNodes #14842

Closed
vtjnash opened this issue Jan 28, 2016 · 1 comment
Closed

missing LineNumberNodes #14842

vtjnash opened this issue Jan 28, 2016 · 1 comment

Comments

@vtjnash
Copy link
Sponsor Member

vtjnash commented Jan 28, 2016

the catch block and the for loop condition copy are missing their line number nodes, causing them to inherit the line number from whatever the previous context happened to be. this breaks backtraces and track malloc.

julia> function try_stacktrace()
           try
               bad_function()
           catch
               return stacktrace()
           end
       end
try_stacktrace (generic function with 1 method)

julia> @code_lowered try_stacktrace()
1-element Array{Any,1}:
 :($(Expr(:lambda, Any[symbol("#self#")], Any[Any[Any[symbol("#self#"),:Any,0]],Any[],1], :(begin  # none, line 2:
        $(Expr(:enter, 0)) # none, line 3:
        GenSym(0) = (Main.bad_function)()
        $(Expr(:leave, 1))
        return GenSym(0)
        0: 
        $(Expr(:leave, 1))
        return (Main.stacktrace)()
    end))))
julia> function a()
         for i = 1:100
          b(i)
         end
       end
a (generic function with 1 method)

julia> @code_lowered a()
1-element Array{Any,1}:
 :($(Expr(:lambda, Any[symbol("#self#")], Any[Any[Any[symbol("#self#"),:Any,0],Any[symbol("#s1"),:Any,2],Any[:i,:Any,18]],Any[],2], :(begin  # none, line 2:
        GenSym(0) = (Main.colon)(1,100)
        #s1 = (top(start))(GenSym(0))
        unless (top(!))((top(done))(GenSym(0),#s1)) goto 1
        2: 
        GenSym(1) = (top(next))(GenSym(0),#s1)
        i = (top(getfield))(GenSym(1),1)
        #s1 = (top(getfield))(GenSym(1),2) # none, line 3:
        (Main.b)(i)
        3: 
        unless (top(!))((top(!))((top(done))(GenSym(0),#s1))) goto 2
        1: 
        0: 
        return
    end))))

ref #14469

@JeffBezanson
Copy link
Sponsor Member

Fixed by #16335

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants