Skip to content

Commit eae3b4c

Browse files
authored
Some more 1.12 compat (#625)
Just what I happned to see driving by.
1 parent fc4aeca commit eae3b4c

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

src/utils.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,8 @@ end
296296

297297
@static if VERSION v"1.12.0-DEV.173"
298298

299-
function getlastline(arg)
300-
debuginfo = linetable(arg)
299+
getlastline(arg) = getlastline(linetable(arg))
300+
function getlastline(debuginfo::Core.DebugInfo)
301301
while true
302302
ltnext = debuginfo.linetable
303303
ltnext === nothing && break

test/debug.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,8 @@ end
146146
cframe, pc = debug_command(frame, :sg)
147147
# Aside: generators can have `Expr(:line, ...)` in their line tables, test that this is OK
148148
lt = JuliaInterpreter.linetable(cframe, 2)
149-
@test isexpr(lt, :line) || isa(lt, Core.LineInfoNode)
149+
@test isexpr(lt, :line) || isa(lt, Core.LineInfoNode) ||
150+
(isdefined(Base.IRShow, :LineInfoNode) && isa(lt, Base.IRShow.LineInfoNode))
150151
@test isa(pc, BreakpointRef)
151152
@test JuliaInterpreter.scopeof(cframe).name === :generatedfoo
152153
cframe, pc = debug_command(cframe, :finish)

test/utils.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,15 @@ end
3131

3232
## For running interpreter frames under resource limitations
3333

34+
if isdefined(Base.IRShow, :LineInfoNode)
35+
struct Aborted # for signaling that some statement or test blocks were interrupted
36+
at::Base.IRShow.LineInfoNode
37+
end
38+
else
3439
struct Aborted # for signaling that some statement or test blocks were interrupted
3540
at::Core.LineInfoNode
3641
end
42+
end
3743

3844
function Aborted(frame::Frame, pc)
3945
lineidx = JuliaInterpreter.codelocs(frame, pc)

0 commit comments

Comments
 (0)