Skip to content

Commit b75482b

Browse files
nsajkoKristofferC
authored andcommitted
_precompilepkgs: interactive progress display: fix unintended capture (#57932)
The variable `str` also exists in one of the enclosing closures. Use a new variable, as was surely intended, instead of capturing and mutating the `str`. Improves the sysimage's resistance to invalidation. (cherry picked from commit fcf492d)
1 parent aa8ff5d commit b75482b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

base/precompilation.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -811,8 +811,8 @@ function _precompilepkgs(pkgs::Vector{String},
811811
# window between print cycles
812812
termwidth = displaysize(io)[2] - 4
813813
if !final_loop
814-
str = sprint(io -> show_progress(io, bar; termwidth, carriagereturn=false); context=io)
815-
print(iostr, Base._truncate_at_width_or_chars(true, str, termwidth), "\n")
814+
s = sprint(io -> show_progress(io, bar; termwidth, carriagereturn=false); context=io)
815+
print(iostr, Base._truncate_at_width_or_chars(true, s, termwidth), "\n")
816816
end
817817
for pkg_config in pkg_queue_show
818818
dep, config = pkg_config

0 commit comments

Comments
 (0)