Skip to content

Commit 4c87cb4

Browse files
authored
Backports release 1.11 (#55936)
Backported PRs: - [x] #55849 <!-- Mmap: fix grow! for non file IOs --> - [x] #55863 <!-- Update TaskLocalRNG docstring according to #49110 --> - [x] #54433 <!-- Root globals in toplevel exprs --> - [x] #55828 <!-- Fix some corner cases of `isapprox` with unsigned integers --> - [x] #55890 <!-- Profile: fix order of fields in heapsnapshot & improve formatting --> - [x] #55884 <!-- inference: add missing `TypeVar` handling for `instanceof_tfunc` --> - [x] #55881 <!-- Install terminfo data under /usr/share/julia --> - [x] #55909 <!-- do not intentionally suppress errors in precompile script from being reported or failing the result --> - [x] #55355 <!-- relocation: account for trailing path separator in depot paths --> - [x] #55917 <!-- fix rawbigints OOB issues --> - [x] #55892 <!-- TOML: Avoid type-pirating `Base.TOML.Parser` --> - [x] #55798 <!-- Broadcast binary ops involving strided triangular --> - [x] #55919 <!-- Limit `@inbounds` to indexing in the dual-iterator branch in `copyto_unaliased!` --> Contains multiple commits, manual intervention needed: - [ ] #54009 <!-- allow extensions to trigger from packages in [deps] --> - [ ] #55509 <!-- Fix cong implementation to be properly random and not just cycling. --> - [ ] #55569 <!-- Add a docs section about loading/precomp/ttfx time tuning --> - [ ] #55824 <!-- Replace regex package module checks with actual code checks --> Non-merged PRs with backport label: - [ ] #55932 <!-- REPL: make UndefVarError aware of imported modules --> - [ ] #55910 <!-- Prevent extensions from blocking parallel pre-compilation --> - [ ] #55908 <!-- add logic to prefer loading modules that are already loaded --> - [ ] #55886 <!-- irrationals: restrict assume effects annotations to known types --> - [ ] #55871 <!-- lowering: don't reverse handler order in `(pop-handler-list ...)` --> - [ ] #55870 <!-- fix infinite recursion in `promote_type` for `Irrational` --> - [ ] #55867 <!-- update `hash` doc string: `widen` not required any more --> - [ ] #55851 <!-- [REPL] Fix #55850 by using `safe_realpath` instead of `abspath` in `projname` --> - [ ] #55813 <!-- Check for conflicting `@ccallable` name before JIT registration --> - [ ] #55743 <!-- doc: heap snapshot viewing --> - [ ] #55741 <!-- Change annotations to use a NamedTuple --> - [ ] #55534 <!-- Set stdlib sources as read-only during installation --> - [ ] #55499 <!-- propagate the terminal's `displaysize` to the `IOContext` used by the REPL --> - [ ] #55458 <!-- Allow for generically extracting unannotated string --> - [ ] #55457 <!-- Make AnnotateChar equality consider annotations --> - [ ] #55220 <!-- `isfile_casesensitive` fixes on Windows --> - [ ] #55169 <!-- `propertynames` for SVD respects private argument --> - [ ] #54457 <!-- Make `String(::Memory)` copy --> - [ ] #53957 <!-- tweak how filtering is done for what packages should be precompiled --> - [ ] #51479 <!-- prevent code loading from lookin in the versioned environment when building Julia --> - [ ] #50813 <!-- More doctests for Sockets and capitalization fix --> - [ ] #50157 <!-- improve docs for `@inbounds` and `Base.@propagate_inbounds` -->
2 parents b4b9add + cb5cd2a commit 4c87cb4

File tree

30 files changed

+330
-118
lines changed

30 files changed

+330
-118
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ endif
405405
$(INSTALL_F) $(JULIAHOME)/contrib/julia.appdata.xml $(DESTDIR)$(datarootdir)/appdata/
406406
# Install terminal info database
407407
ifneq ($(WITH_TERMINFO),0)
408-
cp -R -L $(build_datarootdir)/terminfo $(DESTDIR)$(datarootdir)
408+
cp -R -L $(build_datarootdir)/julia/terminfo $(DESTDIR)$(datarootdir)/julia/
409409
endif
410410

411411
# Update RPATH entries and JL_SYSTEM_IMAGE_PATH if $(private_libdir_rel) != $(build_private_libdir_rel)

base/abstractarray.jl

+2-5
Original file line numberDiff line numberDiff line change
@@ -1096,11 +1096,8 @@ function copyto_unaliased!(deststyle::IndexStyle, dest::AbstractArray, srcstyle:
10961096
end
10971097
else
10981098
# Dual-iterator implementation
1099-
ret = iterate(iterdest)
1100-
@inbounds for a in src
1101-
idx, state = ret::NTuple{2,Any}
1102-
dest[idx] = a
1103-
ret = iterate(iterdest, state)
1099+
for (Idest, Isrc) in zip(iterdest, itersrc)
1100+
@inbounds dest[Idest] = src[Isrc]
11041101
end
11051102
end
11061103
end

base/compiler/tfuncs.jl

+4-4
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ function instanceof_tfunc(@nospecialize(t), astag::Bool=false, @nospecialize(tro
134134
end
135135
return tr, isexact, isconcrete, istype
136136
elseif isa(t, Union)
137-
ta, isexact_a, isconcrete_a, istype_a = instanceof_tfunc(t.a, astag, troot)
138-
tb, isexact_b, isconcrete_b, istype_b = instanceof_tfunc(t.b, astag, troot)
137+
ta, isexact_a, isconcrete_a, istype_a = instanceof_tfunc(unwraptv(t.a), astag, troot)
138+
tb, isexact_b, isconcrete_b, istype_b = instanceof_tfunc(unwraptv(t.b), astag, troot)
139139
isconcrete = isconcrete_a && isconcrete_b
140140
istype = istype_a && istype_b
141141
# most users already handle the Union case, so here we assume that
@@ -549,9 +549,9 @@ add_tfunc(Core.sizeof, 1, 1, sizeof_tfunc, 1)
549549
end
550550
end
551551
if isa(x, Union)
552-
na = nfields_tfunc(𝕃, x.a)
552+
na = nfields_tfunc(𝕃, unwraptv(x.a))
553553
na === Int && return Int
554-
return tmerge(na, nfields_tfunc(𝕃, x.b))
554+
return tmerge(𝕃, na, nfields_tfunc(𝕃, unwraptv(x.b)))
555555
end
556556
return Int
557557
end

base/floatfuncs.jl

+3-1
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,9 @@ function isapprox(x::Integer, y::Integer;
232232
if norm === abs && atol < 1 && rtol == 0
233233
return x == y
234234
else
235-
return norm(x - y) <= max(atol, rtol*max(norm(x), norm(y)))
235+
# We need to take the difference `max` - `min` when comparing unsigned integers.
236+
_x, _y = x < y ? (x, y) : (y, x)
237+
return norm(_y - _x) <= max(atol, rtol*max(norm(_x), norm(_y)))
236238
end
237239
end
238240

base/loading.jl

+16-10
Original file line numberDiff line numberDiff line change
@@ -3119,23 +3119,29 @@ mutable struct CacheHeaderIncludes
31193119
const modpath::Vector{String} # seemingly not needed in Base, but used by Revise
31203120
end
31213121

3122-
function replace_depot_path(path::AbstractString)
3123-
for depot in DEPOT_PATH
3124-
!isdir(depot) && continue
3125-
3126-
# Strip extraneous pathseps through normalization.
3127-
if isdirpath(depot)
3128-
depot = dirname(depot)
3129-
end
3130-
3131-
if startswith(path, depot)
3122+
function replace_depot_path(path::AbstractString, depots::Vector{String}=normalize_depots_for_relocation())
3123+
for depot in depots
3124+
if startswith(path, string(depot, Filesystem.pathsep())) || path == depot
31323125
path = replace(path, depot => "@depot"; count=1)
31333126
break
31343127
end
31353128
end
31363129
return path
31373130
end
31383131

3132+
function normalize_depots_for_relocation()
3133+
depots = String[]
3134+
sizehint!(depots, length(DEPOT_PATH))
3135+
for d in DEPOT_PATH
3136+
isdir(d) || continue
3137+
if isdirpath(d)
3138+
d = dirname(d)
3139+
end
3140+
push!(depots, abspath(d))
3141+
end
3142+
return depots
3143+
end
3144+
31393145
function restore_depot_path(path::AbstractString, depot::AbstractString)
31403146
replace(path, r"^@depot" => depot; count=1)
31413147
end

base/rawbigints.jl

+22-9
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,21 @@ reversed_index(n::Int, i::Int) = n - i - 1
2121
reversed_index(x, i::Int, v::Val) = reversed_index(elem_count(x, v), i)::Int
2222
split_bit_index(x::RawBigInt, i::Int) = divrem(i, word_length(x), RoundToZero)
2323

24+
function get_elem_words_raw(x::RawBigInt{T}, i::Int) where {T}
25+
@boundscheck if (i < 0) || (elem_count(x, Val(:words)) i)
26+
throw(BoundsError(x, i))
27+
end
28+
d = x.d
29+
j = i + 1
30+
(GC.@preserve d unsafe_load(Ptr{T}(pointer(d)), j))::T
31+
end
32+
2433
"""
2534
`i` is the zero-based index of the wanted word in `x`, starting from
2635
the less significant words.
2736
"""
28-
function get_elem(x::RawBigInt{T}, i::Int, ::Val{:words}, ::Val{:ascending}) where {T}
29-
# `i` must be non-negative and less than `x.word_count`
30-
d = x.d
31-
(GC.@preserve d unsafe_load(Ptr{T}(pointer(d)), i + 1))::T
37+
function get_elem(x::RawBigInt, i::Int, ::Val{:words}, ::Val{:ascending})
38+
@inbounds @inline get_elem_words_raw(x, i)
3239
end
3340

3441
function get_elem(x, i::Int, v::Val, ::Val{:descending})
@@ -96,25 +103,31 @@ end
96103

97104
"""
98105
Returns an integer of type `R`, consisting of the `len` most
99-
significant bits of `x`.
106+
significant bits of `x`. If there are less than `len` bits in `x`,
107+
the least significant bits are zeroed.
100108
"""
101109
function truncated(::Type{R}, x::RawBigInt, len::Int) where {R<:Integer}
102110
ret = zero(R)
103111
if 0 < len
104112
word_count, bit_count_in_word = split_bit_index(x, len)
105113
k = word_length(x)
106114
vals = (Val(:words), Val(:descending))
115+
lenx = elem_count(x, first(vals))
107116

108117
for w 0:(word_count - 1)
109118
ret <<= k
110-
word = get_elem(x, w, vals...)
111-
ret |= R(word)
119+
if w < lenx
120+
word = get_elem(x, w, vals...)
121+
ret |= R(word)
122+
end
112123
end
113124

114125
if !iszero(bit_count_in_word)
115126
ret <<= bit_count_in_word
116-
wrd = get_elem(x, word_count, vals...)
117-
ret |= R(wrd >>> (k - bit_count_in_word))
127+
if word_count < lenx
128+
wrd = get_elem(x, word_count, vals...)
129+
ret |= R(wrd >>> (k - bit_count_in_word))
130+
end
118131
end
119132
end
120133
ret::R

base/terminfo.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ function find_terminfo_file(term::String)
262262
append!(terminfo_dirs,
263263
replace(split(ENV["TERMINFO_DIRS"], ':'),
264264
"" => "/usr/share/terminfo"))
265-
push!(terminfo_dirs, normpath(Sys.BINDIR, DATAROOTDIR, "terminfo"))
265+
push!(terminfo_dirs, normpath(Sys.BINDIR, DATAROOTDIR, "julia", "terminfo"))
266266
Sys.isunix() &&
267267
push!(terminfo_dirs, "/etc/terminfo", "/lib/terminfo", "/usr/share/terminfo")
268268
for dir in terminfo_dirs

contrib/generate_precompile.jl

+3-4
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,7 @@ generate_precompile_statements() = try # Make sure `ansi_enablecursor` is printe
342342
print_state("step1" => "F$n_step1")
343343
return :ok
344344
end
345-
Base.errormonitor(step1)
346-
!PARALLEL_PRECOMPILATION && wait(step1)
345+
PARALLEL_PRECOMPILATION ? bind(statements_step1, step1) : wait(step1)
347346

348347
# Create a staging area where all the loaded packages are available
349348
PrecompileStagingArea = Module()
@@ -357,7 +356,7 @@ generate_precompile_statements() = try # Make sure `ansi_enablecursor` is printe
357356
# Make statements unique
358357
statements = Set{String}()
359358
# Execute the precompile statements
360-
for sts in [statements_step1,], statement in sts
359+
for statement in statements_step1
361360
# Main should be completely clean
362361
occursin("Main.", statement) && continue
363362
Base.in!(statement, statements) && continue
@@ -393,6 +392,7 @@ generate_precompile_statements() = try # Make sure `ansi_enablecursor` is printe
393392
println()
394393
# Seems like a reasonable number right now, adjust as needed
395394
# comment out if debugging script
395+
have_repl = false
396396
n_succeeded > (have_repl ? 650 : 90) || @warn "Only $n_succeeded precompile statements"
397397

398398
fetch(step1) == :ok || throw("Step 1 of collecting precompiles failed.")
@@ -403,7 +403,6 @@ generate_precompile_statements() = try # Make sure `ansi_enablecursor` is printe
403403
finally
404404
fancyprint && print(ansi_enablecursor)
405405
GC.gc(true); GC.gc(false); # reduce memory footprint
406-
return
407406
end
408407

409408
generate_precompile_statements()

deps/checksums/Pkg-69938284d6804dd30a24577397f52dfdedbd37e1.tar.gz/md5

-1
This file was deleted.

deps/checksums/Pkg-69938284d6804dd30a24577397f52dfdedbd37e1.tar.gz/sha512

-1
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
83f567b5c65ae36ebd9b5878cf009513
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
bc1e6de2c679b862caeb5c1fb6c3187c9da4dc2e37dc89b5cdf1498c5a26fbe7516773b53c039927abd89a1a9e8215f410b08a3da9d1b6489fe9ca2da60e57d2

deps/terminfo.mk

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ $(BUILDDIR)/TermInfoDB-v$(TERMINFO_VER)/build-checked: $(BUILDDIR)/TermInfoDB-v$
2222
echo 1 > $@
2323

2424
define TERMINFO_INSTALL
25-
mkdir -p $2/$$(build_datarootdir)
26-
cp -R $1/terminfo $2/$$(build_datarootdir)
25+
mkdir -p $2/$$(build_datarootdir)/julia
26+
cp -R $1/terminfo $2/$$(build_datarootdir)/julia/
2727
endef
2828
$(eval $(call staged-install, \
2929
terminfo,TermInfoDB-v$(TERMINFO_VER), \

src/codegen.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -6144,8 +6144,9 @@ static jl_cgval_t emit_expr(jl_codectx_t &ctx, jl_value_t *expr, ssize_t ssaidx_
61446144
jl_value_t *val = expr;
61456145
if (jl_is_quotenode(expr))
61466146
val = jl_fieldref_noalloc(expr, 0);
6147-
if (jl_is_method(ctx.linfo->def.method)) // toplevel exprs are already rooted
6148-
val = jl_ensure_rooted(ctx, val);
6147+
// Toplevel exprs are rooted but because codegen assumes this is constant, it removes the write barriers for this code.
6148+
// This means we have to globally root the value here. (The other option would be to change how we optimize toplevel code)
6149+
val = jl_ensure_rooted(ctx, val);
61496150
return mark_julia_const(ctx, val);
61506151
}
61516152

src/gc-heap-snapshot.cpp

+18-24
Original file line numberDiff line numberDiff line change
@@ -607,38 +607,32 @@ void final_serialize_heap_snapshot(ios_t *json, ios_t *strings, HeapSnapshot &sn
607607
{
608608
// mimicking https://github.com/nodejs/node/blob/5fd7a72e1c4fbaf37d3723c4c81dce35c149dc84/deps/v8/src/profiler/heap-snapshot-generator.cc#L2567-L2567
609609
// also https://github.com/microsoft/vscode-v8-heap-tools/blob/c5b34396392397925ecbb4ecb904a27a2754f2c1/v8-heap-parser/src/decoder.rs#L43-L51
610-
ios_printf(json, "{\"snapshot\":{");
610+
ios_printf(json, "{\"snapshot\":{\n");
611611

612-
ios_printf(json, "\"meta\":{");
613-
ios_printf(json, "\"node_fields\":[\"type\",\"name\",\"id\",\"self_size\",\"edge_count\",\"trace_node_id\",\"detachedness\"],");
614-
ios_printf(json, "\"node_types\":[");
612+
ios_printf(json, " \"meta\":{\n");
613+
ios_printf(json, " \"node_fields\":[\"type\",\"name\",\"id\",\"self_size\",\"edge_count\",\"trace_node_id\",\"detachedness\"],\n");
614+
ios_printf(json, " \"node_types\":[");
615615
snapshot.node_types.print_json_array(json, false);
616616
ios_printf(json, ",");
617-
ios_printf(json, "\"string\", \"number\", \"number\", \"number\", \"number\", \"number\"],");
618-
ios_printf(json, "\"edge_fields\":[\"type\",\"name_or_index\",\"to_node\"],");
619-
ios_printf(json, "\"edge_types\":[");
617+
ios_printf(json, "\"string\", \"number\", \"number\", \"number\", \"number\", \"number\"],\n");
618+
ios_printf(json, " \"edge_fields\":[\"type\",\"name_or_index\",\"to_node\"],\n");
619+
ios_printf(json, " \"edge_types\":[");
620620
snapshot.edge_types.print_json_array(json, false);
621621
ios_printf(json, ",");
622-
ios_printf(json, "\"string_or_number\",\"from_node\"],");
622+
ios_printf(json, "\"string_or_number\",\"from_node\"],\n");
623623
// not used. Required by microsoft/vscode-v8-heap-tools
624-
ios_printf(json, "\"trace_function_info_fields\":[\"function_id\",\"name\",\"script_name\",\"script_id\",\"line\",\"column\"],");
625-
ios_printf(json, "\"trace_node_fields\":[\"id\",\"function_info_index\",\"count\",\"size\",\"children\"],");
626-
ios_printf(json, "\"sample_fields\":[\"timestamp_us\",\"last_assigned_id\"],");
627-
ios_printf(json, "\"location_fields\":[\"object_index\",\"script_id\",\"line\",\"column\"]");
624+
ios_printf(json, " \"trace_function_info_fields\":[\"function_id\",\"name\",\"script_name\",\"script_id\",\"line\",\"column\"],\n");
625+
ios_printf(json, " \"trace_node_fields\":[\"id\",\"function_info_index\",\"count\",\"size\",\"children\"],\n");
626+
ios_printf(json, " \"sample_fields\":[\"timestamp_us\",\"last_assigned_id\"],\n");
627+
ios_printf(json, " \"location_fields\":[\"object_index\",\"script_id\",\"line\",\"column\"]\n");
628628
// end not used
629-
ios_printf(json, "},\n"); // end "meta"
629+
ios_printf(json, " },\n"); // end "meta"
630630

631-
ios_printf(json, "\"node_count\":%zu,", snapshot.num_nodes);
632-
ios_printf(json, "\"edge_count\":%zu,", snapshot.num_edges);
633-
ios_printf(json, "\"trace_function_count\":0"); // not used. Required by microsoft/vscode-v8-heap-tools
634-
ios_printf(json, "},\n"); // end "snapshot"
635-
636-
// not used. Required by microsoft/vscode-v8-heap-tools
637-
ios_printf(json, "\"trace_function_infos\":[],");
638-
ios_printf(json, "\"trace_tree\":[],");
639-
ios_printf(json, "\"samples\":[],");
640-
ios_printf(json, "\"locations\":[]");
641-
// end not used
631+
ios_printf(json, " \"node_count\":%zu,\n", snapshot.num_nodes);
632+
ios_printf(json, " \"edge_count\":%zu,\n", snapshot.num_edges);
633+
ios_printf(json, " \"trace_function_count\":0\n"); // not used. Required by microsoft/vscode-v8-heap-tools
634+
ios_printf(json, "}\n"); // end "snapshot"
642635

636+
// this } is removed by the julia reassembler in Profile
643637
ios_printf(json, "}");
644638
}

src/precompile.c

+13-4
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,17 @@ void write_srctext(ios_t *f, jl_array_t *udeps, int64_t srctextpos) {
3939
static jl_value_t *replace_depot_func = NULL;
4040
if (!replace_depot_func)
4141
replace_depot_func = jl_get_global(jl_base_module, jl_symbol("replace_depot_path"));
42+
static jl_value_t *normalize_depots_func = NULL;
43+
if (!normalize_depots_func)
44+
normalize_depots_func = jl_get_global(jl_base_module, jl_symbol("normalize_depots_for_relocation"));
4245
ios_t srctext;
43-
jl_value_t *deptuple = NULL;
44-
JL_GC_PUSH2(&deptuple, &udeps);
46+
jl_value_t *deptuple = NULL, *depots = NULL;
47+
JL_GC_PUSH3(&deptuple, &udeps, &depots);
48+
jl_task_t *ct = jl_current_task;
49+
size_t last_age = ct->world_age;
50+
ct->world_age = jl_atomic_load_acquire(&jl_world_counter);
51+
depots = jl_apply(&normalize_depots_func, 1);
52+
ct->world_age = last_age;
4553
for (size_t i = 0; i < len; i++) {
4654
deptuple = jl_array_ptr_ref(udeps, i);
4755
jl_value_t *depmod = jl_fieldref(deptuple, 0); // module
@@ -60,13 +68,14 @@ void write_srctext(ios_t *f, jl_array_t *udeps, int64_t srctextpos) {
6068
}
6169

6270
jl_value_t **replace_depot_args;
63-
JL_GC_PUSHARGS(replace_depot_args, 2);
71+
JL_GC_PUSHARGS(replace_depot_args, 3);
6472
replace_depot_args[0] = replace_depot_func;
6573
replace_depot_args[1] = abspath;
74+
replace_depot_args[2] = depots;
6675
jl_task_t *ct = jl_current_task;
6776
size_t last_age = ct->world_age;
6877
ct->world_age = jl_atomic_load_acquire(&jl_world_counter);
69-
jl_value_t *depalias = (jl_value_t*)jl_apply(replace_depot_args, 2);
78+
jl_value_t *depalias = (jl_value_t*)jl_apply(replace_depot_args, 3);
7079
ct->world_age = last_age;
7180
JL_GC_POP();
7281

src/staticdata_utils.c

+14-6
Original file line numberDiff line numberDiff line change
@@ -752,6 +752,16 @@ static int64_t write_dependency_list(ios_t *s, jl_array_t* worklist, jl_array_t
752752
static jl_value_t *replace_depot_func = NULL;
753753
if (!replace_depot_func)
754754
replace_depot_func = jl_get_global(jl_base_module, jl_symbol("replace_depot_path"));
755+
static jl_value_t *normalize_depots_func = NULL;
756+
if (!normalize_depots_func)
757+
normalize_depots_func = jl_get_global(jl_base_module, jl_symbol("normalize_depots_for_relocation"));
758+
759+
jl_value_t *depots = NULL, *prefs_hash = NULL, *prefs_list = NULL;
760+
JL_GC_PUSH2(&depots, &prefs_list);
761+
last_age = ct->world_age;
762+
ct->world_age = jl_atomic_load_acquire(&jl_world_counter);
763+
depots = jl_apply(&normalize_depots_func, 1);
764+
ct->world_age = last_age;
755765

756766
// write a placeholder for total size so that we can quickly seek past all of the
757767
// dependencies if we don't need them
@@ -764,13 +774,14 @@ static int64_t write_dependency_list(ios_t *s, jl_array_t* worklist, jl_array_t
764774

765775
if (replace_depot_func) {
766776
jl_value_t **replace_depot_args;
767-
JL_GC_PUSHARGS(replace_depot_args, 2);
777+
JL_GC_PUSHARGS(replace_depot_args, 3);
768778
replace_depot_args[0] = replace_depot_func;
769779
replace_depot_args[1] = deppath;
780+
replace_depot_args[2] = depots;
770781
ct = jl_current_task;
771782
size_t last_age = ct->world_age;
772783
ct->world_age = jl_atomic_load_acquire(&jl_world_counter);
773-
deppath = (jl_value_t*)jl_apply(replace_depot_args, 2);
784+
deppath = (jl_value_t*)jl_apply(replace_depot_args, 3);
774785
ct->world_age = last_age;
775786
JL_GC_POP();
776787
}
@@ -803,9 +814,6 @@ static int64_t write_dependency_list(ios_t *s, jl_array_t* worklist, jl_array_t
803814
write_int32(s, 0); // terminator, for ease of reading
804815

805816
// Calculate Preferences hash for current package.
806-
jl_value_t *prefs_hash = NULL;
807-
jl_value_t *prefs_list = NULL;
808-
JL_GC_PUSH1(&prefs_list);
809817
if (jl_base_module) {
810818
// Toplevel module is the module we're currently compiling, use it to get our preferences hash
811819
jl_value_t * toplevel = (jl_value_t*)jl_get_global(jl_base_module, jl_symbol("__toplevel__"));
@@ -852,7 +860,7 @@ static int64_t write_dependency_list(ios_t *s, jl_array_t* worklist, jl_array_t
852860
write_int32(s, 0);
853861
write_uint64(s, 0);
854862
}
855-
JL_GC_POP(); // for prefs_list
863+
JL_GC_POP(); // for depots, prefs_list
856864

857865
// write a dummy file position to indicate the beginning of the source-text
858866
pos = ios_pos(s);

stdlib/LinearAlgebra/src/symmetric.jl

+4-4
Original file line numberDiff line numberDiff line change
@@ -536,10 +536,10 @@ for f in (:+, :-)
536536
@eval begin
537537
$f(A::Hermitian, B::Symmetric{<:Real}) = $f(A, Hermitian(parent(B), sym_uplo(B.uplo)))
538538
$f(A::Symmetric{<:Real}, B::Hermitian) = $f(Hermitian(parent(A), sym_uplo(A.uplo)), B)
539-
$f(A::SymTridiagonal, B::Symmetric) = Symmetric($f(A, B.data), sym_uplo(B.uplo))
540-
$f(A::Symmetric, B::SymTridiagonal) = Symmetric($f(A.data, B), sym_uplo(A.uplo))
541-
$f(A::SymTridiagonal{<:Real}, B::Hermitian) = Hermitian($f(A, B.data), sym_uplo(B.uplo))
542-
$f(A::Hermitian, B::SymTridiagonal{<:Real}) = Hermitian($f(A.data, B), sym_uplo(A.uplo))
539+
$f(A::SymTridiagonal, B::Symmetric) = $f(Symmetric(A, sym_uplo(B.uplo)), B)
540+
$f(A::Symmetric, B::SymTridiagonal) = $f(A, Symmetric(B, sym_uplo(A.uplo)))
541+
$f(A::SymTridiagonal{<:Real}, B::Hermitian) = $f(Hermitian(A, sym_uplo(B.uplo)), B)
542+
$f(A::Hermitian, B::SymTridiagonal{<:Real}) = $f(A, Hermitian(B, sym_uplo(A.uplo)))
543543
end
544544
end
545545

0 commit comments

Comments
 (0)