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 1 commit
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
7 changes: 3 additions & 4 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 @@ -801,7 +800,7 @@ function _simplify_include_frames(trace)
i -= 1
fredcallaway marked this conversation as resolved.
Show resolved Hide resolved
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