Skip to content

Commit 128f000

Browse files
committed
Restore support for Expr(:line, ...) nodes
1 parent ada7ba6 commit 128f000

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/utils.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ function linetable(arg)
269269
end
270270
return (arg::CodeInfo).linetable::Vector{Any}
271271
end
272-
linetable(arg, i::Integer) = linetable(arg)[i]::LineTypes
272+
linetable(arg, i::Integer) = linetable(arg)[i]::Union{Expr,LineTypes}
273273

274274
function codelocs(arg)
275275
if isa(arg, Frame)

test/debug.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ end
142142
# This time, step into the generated function itself
143143
frame = enter_call_expr(:($(callgenerated)()))
144144
f, pc = debug_command(frame, :sg)
145+
# Aside: generators can have `Expr(:line, ...)` in their line tables, test that this is OK
146+
@test isexpr(JuliaInterpreter.linetable(f, 2), :line)
145147
@test isa(pc, BreakpointRef)
146148
@test JuliaInterpreter.scopeof(f).name == :generatedfoo
147149
stmt = JuliaInterpreter.pc_expr(f)

0 commit comments

Comments
 (0)