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

while loop -> for loop in _simplify_include_frames (fixes #41566) #41622

Merged
merged 2 commits into from
Jul 20, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions base/errorshow.jl
Original file line number Diff line number Diff line change
Expand Up @@ -773,10 +773,9 @@ end
# For improved user experience, filter out frames for include() implementation
# - see #33065. See also #35371 for extended discussion of internal frames.
function _simplify_include_frames(trace)
i = length(trace)
kept_frames = trues(i)
kept_frames = trues(length(trace))
first_ignored = nothing
while i >= 1
for i in length(trace):-1:1
frame::StackFrame, _ = trace[i]
mod = parentmodule(frame)
if first_ignored === nothing
Expand All @@ -798,10 +797,9 @@ function _simplify_include_frames(trace)
first_ignored = nothing
end
end
i -= 1
end
if first_ignored !== nothing
kept_frames[i:first_ignored] .= false
kept_frames[1:first_ignored] .= false
end
return trace[kept_frames]
end
Expand Down