Skip to content

Commit 28ec168

Browse files
authored
fix two Core.Box and test that package is empty of such boxes (#708)
1 parent 9897789 commit 28ec168

File tree

3 files changed

+21
-12
lines changed

3 files changed

+21
-12
lines changed

src/commands.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,9 @@ function until_line!(interp::Interpreter, frame::Frame, line::Union{Nothing, Int
204204
pc = frame.pc
205205
initialline, initialfile = linenumber(frame, pc), getfile(frame, pc)
206206
line === nothing && (line = initialline + 1)
207+
line_final = line
207208
pc = next_until!(interp, frame, istoplevel) do frame::Frame
208-
return is_return(pc_expr(frame)) || (linenumber(frame) >= line && getfile(frame) == initialfile)
209+
return is_return(pc_expr(frame)) || (linenumber(frame) >= line_final && getfile(frame) == initialfile)
209210
end
210211
(pc === nothing || isa(pc, BreakpointRef)) && return pc
211212
maybe_step_through_kwprep!(interp, frame, istoplevel)

src/types.jl

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,21 @@ else
171171
is_breakpoint_marker(stmt) = stmt === __BREAK_POINT_MARKER__
172172
end
173173

174+
@static if VERSION v"1.12.0-DEV.173"
175+
function pushuniquefiles!(unique_files::Set{Symbol}, lt)
176+
for edge in lt.edges
177+
pushuniquefiles!(unique_files, edge)
178+
end
179+
linetable = lt.linetable
180+
if linetable === nothing
181+
push!(unique_files, Base.IRShow.debuginfo_file1(lt))
182+
else
183+
pushuniquefiles!(unique_files, linetable)
184+
end
185+
return unique_files
186+
end
187+
end
188+
174189
function FrameCode(scope, src::CodeInfo; generator=false, optimize=true)
175190
if optimize
176191
src, methodtables = optimize!(copy(src), scope)
@@ -196,17 +211,6 @@ function FrameCode(scope, src::CodeInfo; generator=false, optimize=true)
196211
lt = linetable(src)
197212
unique_files = Set{Symbol}()
198213
@static if VERSION v"1.12.0-DEV.173"
199-
function pushuniquefiles!(unique_files::Set{Symbol}, lt)
200-
for edge in lt.edges
201-
pushuniquefiles!(unique_files, edge)
202-
end
203-
linetable = lt.linetable
204-
if linetable === nothing
205-
push!(unique_files, Base.IRShow.debuginfo_file1(lt))
206-
else
207-
pushuniquefiles!(unique_files, linetable)
208-
end
209-
end
210214
pushuniquefiles!(unique_files, lt)
211215
else # VERSION < v"1.12.0-DEV.173"
212216
for entry in lt

test/runtests.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ using Logging
44

55
@test isempty(detect_ambiguities(JuliaInterpreter, Base, Core))
66

7+
if isdefined(Test, :detect_closure_boxes)
8+
@test isempty(Test.detect_closure_boxes(JuliaInterpreter))
9+
end
10+
711
if !JuliaInterpreter.isdefinedglobal(@__MODULE__, :read_and_parse)
812
include("utils.jl")
913
end

0 commit comments

Comments
 (0)