Skip to content

Commit 26291f5

Browse files
authored
Backports for Julia 1.11.0-rc2 (#54925)
Backported PRs: - [x] #54201 <!-- Fix generic triangular solves with empty matrices --> - [x] #54358 <!-- Create `jl_clear_coverage_data` to dynamically reset coverage --> - [x] #54908 <!-- LazyString in interpolated error messages in threadingconstructs --> - [x] #54952 <!-- LAPACK: Avoid repr call in `chkvalidparam` --> - [x] #54898 <!-- fix concurrent module loading return value --> - [x] #55082 <!-- Add fast method for copyto!(::Memory, ::Memory) --> - [x] #55084 <!-- Use triple quotes in TOML.print when string contains newline --> - [x] #55141 <!-- Update the aarch64 devdocs to reflect the current state of its support --> - [x] #54955 <!-- don't throw EOFError from sleep --> - [x] #54871 <!-- Make warn missed transformations pass optional --> - [x] #55178 <!-- Compat for `Base.@nospecializeinfer` --> - [x] #55197 <!-- compat notice for a[begin] indexing --> - [x] #54917 <!-- Fix potential underrun with annotation merging --> - [x] #55209 <!-- correction to compat notice for a[begin] --> - [x] #55203 <!-- document mutable struct const fields --> - [x] #54791 <!-- Bump libblastrampoline to v5.10.1 --> - [x] #54950 <!-- SuiteSparse: Bump version --> - [x] #54956 <!-- Fix accidental early evaluation of imported `using` binding --> - [x] #54996 <!-- inference: add missing `MustAlias` widening in `_getfield_tfunc` --> - [x] #55070 <!-- LinearAlgebra: LazyString in error messages for Diagonal/Bidiagonal --> - [x] #54574 <!-- Make ScopedValues public --> - [x] #54739 <!-- finish implementation of upgradable stdlibs --> - [x] #54965 <!-- RFC: Make `include_dependency(path; track_content=true)` the default --> - [x] #53286 <!-- Raise an error when using `include_dependency` with non-existent file or directory --> - [x] #55066 <!-- fix loading of repeated/concurrent modules --> - [x] #52694 <!-- Reinstate similar for AbstractQ for backward compatibility --> - [x] #55218 <!-- Artifacts: use a different way of getting the UUID of a module --> - [x] #54891 <!-- #54739-related fixes for loading stdlibs --> - [x] #55072 <!-- trace-compile: don't generate `precompile` statements for OpaqueClosure methods --> - [x] #55188 <!-- Make Core.TypeofUnion use the type method table --> Need manual backport: - [ ] #55052 <!-- Fix `(l/r)mul!` with `Diagonal`/`Bidiagonal` --> Contains multiple commits, manual intervention needed: Non-merged PRs with backport label: - [ ] #55169 <!-- `propertynames` for SVD respects private argument --> - [ ] #55148 <!-- Random: Mark unexported public symbols as public --> - [ ] #55017 <!-- TOML: Make `Dates` a type parameter --> - [ ] #55013 <!-- [docs] change docstring to match code --> - [ ] #54919 <!-- Fix annotated join with non-concrete eltype iters --> - [ ] #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` --> - [ ] #41244 <!-- Fix shell `cd` error when working dir has been deleted -->
2 parents 46e4740 + c2dcb7e commit 26291f5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+745
-516
lines changed

NEWS.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ New library functions
8888
* `Sys.username()` can be used to return the current user's username ([#51897]).
8989
* `Sys.isreadable(), Sys.iswritable()` can be used to check if the current user has access permissions
9090
that permit reading and writing, respectively. ([#53320]).
91-
* `wrap(Array, m::Union{MemoryRef{T}, Memory{T}}, dims)` is the safe counterpart to `unsafe_wrap` ([#52049]).
9291
* `GC.logging_enabled()` can be used to test whether GC logging has been enabled via `GC.enable_logging` ([#51647]).
9392
* `IdSet` is now exported from Base and considered public ([#53262]).
9493
* `@time` now reports a count of any lock conflicts where a `ReentrantLock` had to wait, plus a new macro
@@ -142,12 +141,6 @@ Standard library changes
142141
* The new `@styled_str` string macro provides a convenient way of creating a
143142
`AnnotatedString` with various faces or other attributes applied ([#49586]).
144143

145-
#### JuliaSyntaxHighlighting
146-
147-
* A new standard library for applying syntax highlighting to Julia code, this
148-
uses `JuliaSyntax` and `StyledStrings` to implement a `highlight` function
149-
that creates an `AnnotatedString` with syntax highlighting applied.
150-
151144
#### Libdl
152145

153146
* A new `LazyLibrary` type is exported from `Libdl` for use in building chained lazy library

base/Base.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,10 @@ function __init__()
604604
init_active_project()
605605
append!(empty!(_sysimage_modules), keys(loaded_modules))
606606
empty!(explicit_loaded_modules)
607+
@assert isempty(loaded_precompiles)
608+
for (mod, key) in module_keys
609+
loaded_precompiles[key => module_build_id(mod)] = mod
610+
end
607611
if haskey(ENV, "JULIA_MAX_NUM_PRECOMPILE_FILES")
608612
MAX_NUM_PRECOMPILE_FILES[] = parse(Int, ENV["JULIA_MAX_NUM_PRECOMPILE_FILES"])
609613
end

base/array.jl

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ isbitsunion(u::Type) = u isa Union && allocatedinline(u)
216216
function _unsetindex!(A::Array, i::Int)
217217
@inline
218218
@boundscheck checkbounds(A, i)
219-
@inbounds _unsetindex!(GenericMemoryRef(A.ref, i))
219+
@inbounds _unsetindex!(memoryref(A.ref, i))
220220
return A
221221
end
222222

@@ -239,14 +239,14 @@ function isassigned(a::Array, i::Int...)
239239
@_noub_if_noinbounds_meta
240240
@boundscheck checkbounds(Bool, a, i...) || return false
241241
ii = _sub2ind(size(a), i...)
242-
return @inbounds isassigned(memoryref(a.ref, ii, false))
242+
return @inbounds isassigned(memoryrefnew(a.ref, ii, false))
243243
end
244244

245245
function isassigned(a::Vector, i::Int) # slight compiler simplification for the most common case
246246
@inline
247247
@_noub_if_noinbounds_meta
248248
@boundscheck checkbounds(Bool, a, i) || return false
249-
return @inbounds isassigned(memoryref(a.ref, i, false))
249+
return @inbounds isassigned(memoryrefnew(a.ref, i, false))
250250
end
251251

252252

@@ -281,7 +281,7 @@ the same manner as C.
281281
"""
282282
function unsafe_copyto!(dest::Array, doffs, src::Array, soffs, n)
283283
n == 0 && return dest
284-
unsafe_copyto!(GenericMemoryRef(dest.ref, doffs), GenericMemoryRef(src.ref, soffs), n)
284+
unsafe_copyto!(memoryref(dest.ref, doffs), memoryref(src.ref, soffs), n)
285285
return dest
286286
end
287287

@@ -303,8 +303,8 @@ function _copyto_impl!(dest::Union{Array,Memory}, doffs::Integer, src::Union{Arr
303303
n > 0 || _throw_argerror("Number of elements to copy must be non-negative.")
304304
@boundscheck checkbounds(dest, doffs:doffs+n-1)
305305
@boundscheck checkbounds(src, soffs:soffs+n-1)
306-
@inbounds let dest = GenericMemoryRef(dest isa Array ? getfield(dest, :ref) : dest, doffs)
307-
src = GenericMemoryRef(src isa Array ? getfield(src, :ref) : src, soffs)
306+
@inbounds let dest = memoryref(dest isa Array ? getfield(dest, :ref) : dest, doffs),
307+
src = memoryref(src isa Array ? getfield(src, :ref) : src, soffs)
308308
unsafe_copyto!(dest, src, n)
309309
end
310310
return dest
@@ -348,7 +348,7 @@ copy
348348
@_nothrow_meta
349349
ref = a.ref
350350
newmem = ccall(:jl_genericmemory_copy_slice, Ref{Memory{T}}, (Any, Ptr{Cvoid}, Int), ref.mem, ref.ptr_or_offset, length(a))
351-
return $(Expr(:new, :(typeof(a)), :(Core.memoryref(newmem)), :(a.size)))
351+
return $(Expr(:new, :(typeof(a)), :(memoryref(newmem)), :(a.size)))
352352
end
353353

354354
## Constructors ##
@@ -973,21 +973,21 @@ function setindex! end
973973
function setindex!(A::Array{T}, x, i::Int) where {T}
974974
@_noub_if_noinbounds_meta
975975
@boundscheck (i - 1)%UInt < length(A)%UInt || throw_boundserror(A, (i,))
976-
memoryrefset!(memoryref(A.ref, i, false), x isa T ? x : convert(T,x)::T, :not_atomic, false)
976+
memoryrefset!(memoryrefnew(A.ref, i, false), x isa T ? x : convert(T,x)::T, :not_atomic, false)
977977
return A
978978
end
979979
function setindex!(A::Array{T}, x, i1::Int, i2::Int, I::Int...) where {T}
980980
@inline
981981
@_noub_if_noinbounds_meta
982982
@boundscheck checkbounds(A, i1, i2, I...) # generally _to_linear_index requires bounds checking
983-
memoryrefset!(memoryref(A.ref, _to_linear_index(A, i1, i2, I...), false), x isa T ? x : convert(T,x)::T, :not_atomic, false)
983+
memoryrefset!(memoryrefnew(A.ref, _to_linear_index(A, i1, i2, I...), false), x isa T ? x : convert(T,x)::T, :not_atomic, false)
984984
return A
985985
end
986986

987987
__safe_setindex!(A::Vector{Any}, @nospecialize(x), i::Int) = (@inline; @_nothrow_noub_meta;
988-
memoryrefset!(memoryref(A.ref, i, false), x, :not_atomic, false); return A)
988+
memoryrefset!(memoryrefnew(A.ref, i, false), x, :not_atomic, false); return A)
989989
__safe_setindex!(A::Vector{T}, x::T, i::Int) where {T} = (@inline; @_nothrow_noub_meta;
990-
memoryrefset!(memoryref(A.ref, i, false), x, :not_atomic, false); return A)
990+
memoryrefset!(memoryrefnew(A.ref, i, false), x, :not_atomic, false); return A)
991991
__safe_setindex!(A::Vector{T}, x, i::Int) where {T} = (@inline;
992992
__safe_setindex!(A, convert(T, x)::T, i))
993993

@@ -1059,7 +1059,7 @@ function _growbeg!(a::Vector, delta::Integer)
10591059
setfield!(a, :size, (newlen,))
10601060
# if offset is far enough advanced to fit data in existing memory without copying
10611061
if delta <= offset - 1
1062-
setfield!(a, :ref, @inbounds GenericMemoryRef(ref, 1 - delta))
1062+
setfield!(a, :ref, @inbounds memoryref(ref, 1 - delta))
10631063
else
10641064
@noinline (function()
10651065
memlen = length(mem)
@@ -1078,7 +1078,7 @@ function _growbeg!(a::Vector, delta::Integer)
10781078
newmem = array_new_memory(mem, newmemlen)
10791079
end
10801080
unsafe_copyto!(newmem, newoffset + delta, mem, offset, len)
1081-
setfield!(a, :ref, @inbounds GenericMemoryRef(newmem, newoffset))
1081+
setfield!(a, :ref, @inbounds memoryref(newmem, newoffset))
10821082
end)()
10831083
end
10841084
return
@@ -1113,7 +1113,7 @@ function _growend!(a::Vector, delta::Integer)
11131113
newmem = array_new_memory(mem, newmemlen2)
11141114
newoffset = offset
11151115
end
1116-
newref = @inbounds GenericMemoryRef(newmem, newoffset)
1116+
newref = @inbounds memoryref(newmem, newoffset)
11171117
unsafe_copyto!(newref, ref, len)
11181118
setfield!(a, :ref, newref)
11191119
end)()
@@ -1142,7 +1142,7 @@ function _growat!(a::Vector, i::Integer, delta::Integer)
11421142
prefer_start = i <= div(len, 2)
11431143
# if offset is far enough advanced to fit data in beginning of the memory
11441144
if prefer_start && delta <= offset - 1
1145-
newref = @inbounds GenericMemoryRef(mem, offset - delta)
1145+
newref = @inbounds memoryref(mem, offset - delta)
11461146
unsafe_copyto!(newref, ref, i)
11471147
setfield!(a, :ref, newref)
11481148
for j in i:i+delta-1
@@ -1159,7 +1159,7 @@ function _growat!(a::Vector, i::Integer, delta::Integer)
11591159
newmemlen = max(overallocation(memlen), len+2*delta+1)
11601160
newoffset = (newmemlen - newlen) ÷ 2 + 1
11611161
newmem = array_new_memory(mem, newmemlen)
1162-
newref = @inbounds GenericMemoryRef(newmem, newoffset)
1162+
newref = @inbounds memoryref(newmem, newoffset)
11631163
unsafe_copyto!(newref, ref, i-1)
11641164
unsafe_copyto!(newmem, newoffset + delta + i - 1, mem, offset + i - 1, len - i + 1)
11651165
setfield!(a, :ref, newref)
@@ -1176,7 +1176,7 @@ function _deletebeg!(a::Vector, delta::Integer)
11761176
end
11771177
newlen = len - delta
11781178
if newlen != 0 # if newlen==0 we could accidentally index past the memory
1179-
newref = @inbounds GenericMemoryRef(a.ref, delta + 1)
1179+
newref = @inbounds memoryref(a.ref, delta + 1)
11801180
setfield!(a, :ref, newref)
11811181
end
11821182
setfield!(a, :size, (newlen,))
@@ -1491,16 +1491,16 @@ function sizehint!(a::Vector, sz::Integer; first::Bool=false, shrink::Bool=true)
14911491
end
14921492
newmem = array_new_memory(mem, sz)
14931493
if first
1494-
newref = GenericMemoryRef(newmem, inc + 1)
1494+
newref = memoryref(newmem, inc + 1)
14951495
else
1496-
newref = GenericMemoryRef(newmem)
1496+
newref = memoryref(newmem)
14971497
end
14981498
unsafe_copyto!(newref, ref, len)
14991499
setfield!(a, :ref, newref)
15001500
elseif first
15011501
_growbeg!(a, inc)
15021502
newref = getfield(a, :ref)
1503-
newref = GenericMemoryRef(newref, inc + 1)
1503+
newref = memoryref(newref, inc + 1)
15041504
setfield!(a, :size, (len,)) # undo the size change from _growbeg!
15051505
setfield!(a, :ref, newref) # undo the offset change from _growbeg!
15061506
else # last
@@ -3075,15 +3075,17 @@ function _wrap(ref::MemoryRef{T}, dims::NTuple{N, Int}) where {T, N}
30753075
mem_len = length(mem) + 1 - memoryrefoffset(ref)
30763076
len = Core.checked_dims(dims...)
30773077
@boundscheck mem_len >= len || invalid_wrap_err(mem_len, dims, len)
3078-
if N != 1 && !(ref === GenericMemoryRef(mem) && len === mem_len)
3078+
if N != 1 && !(ref === memoryref(mem) && len === mem_len)
30793079
mem = ccall(:jl_genericmemory_slice, Memory{T}, (Any, Ptr{Cvoid}, Int), mem, ref.ptr_or_offset, len)
3080-
ref = MemoryRef(mem)
3080+
ref = memoryref(mem)
30813081
end
30823082
return ref
30833083
end
30843084

3085-
@noinline invalid_wrap_err(len, dims, proddims) = throw(DimensionMismatch(
3086-
"Attempted to wrap a MemoryRef of length $len with an Array of size dims=$dims, which is invalid because prod(dims) = $proddims > $len, so that the array would have more elements than the underlying memory can store."))
3085+
@noinline invalid_wrap_err(len, dims, proddims) = throw(DimensionMismatch(LazyString(
3086+
"Attempted to wrap a MemoryRef of length ", len, " with an Array of size dims=", dims,
3087+
" which is invalid because prod(dims) = ", proddims, " > ", len,
3088+
" so that the array would have more elements than the underlying memory can store.")))
30873089

30883090
@eval @propagate_inbounds function wrap(::Type{Array}, m::MemoryRef{T}, dims::NTuple{N, Integer}) where {T, N}
30893091
dims = convert(Dims, dims)
@@ -3093,7 +3095,7 @@ end
30933095

30943096
@eval @propagate_inbounds function wrap(::Type{Array}, m::Memory{T}, dims::NTuple{N, Integer}) where {T, N}
30953097
dims = convert(Dims, dims)
3096-
ref = _wrap(MemoryRef(m), dims)
3098+
ref = _wrap(memoryref(m), dims)
30973099
$(Expr(:new, :(Array{T, N}), :ref, :dims))
30983100
end
30993101
@eval @propagate_inbounds function wrap(::Type{Array}, m::MemoryRef{T}, l::Integer) where {T}
@@ -3103,11 +3105,11 @@ end
31033105
end
31043106
@eval @propagate_inbounds function wrap(::Type{Array}, m::Memory{T}, l::Integer) where {T}
31053107
dims = (Int(l),)
3106-
ref = _wrap(MemoryRef(m), (l,))
3108+
ref = _wrap(memoryref(m), (l,))
31073109
$(Expr(:new, :(Array{T, 1}), :ref, :dims))
31083110
end
31093111
@eval @propagate_inbounds function wrap(::Type{Array}, m::Memory{T}) where {T}
3110-
ref = MemoryRef(m)
3112+
ref = memoryref(m)
31113113
dims = (length(m),)
31123114
$(Expr(:new, :(Array{T, 1}), :ref, :dims))
31133115
end

base/asyncevent.jl

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,11 @@ function _trywait(t::Union{Timer, AsyncCondition})
127127
t isa Timer || Core.Intrinsics.atomic_fence(:acquire_release)
128128
else
129129
if !isopen(t)
130-
close(t) # wait for the close to complete
131-
return false
130+
set = t.set
131+
if !set
132+
close(t) # wait for the close to complete
133+
return false
134+
end
132135
end
133136
iolock_begin()
134137
set = t.set
@@ -151,7 +154,7 @@ function _trywait(t::Union{Timer, AsyncCondition})
151154
end
152155
iolock_end()
153156
end
154-
@atomic :monotonic t.set = false
157+
@atomic :monotonic t.set = false # if there are multiple waiters, an unspecified number may short-circuit past here
155158
return set
156159
end
157160

@@ -161,14 +164,14 @@ function wait(t::Union{Timer, AsyncCondition})
161164
end
162165

163166

164-
isopen(t::Union{Timer, AsyncCondition}) = t.isopen && t.handle != C_NULL
167+
isopen(t::Union{Timer, AsyncCondition}) = @atomic :acquire t.isopen
165168

166169
function close(t::Union{Timer, AsyncCondition})
167-
t.handle == C_NULL && return # short-circuit path
170+
t.handle == C_NULL && !t.isopen && return # short-circuit path, :monotonic
168171
iolock_begin()
169172
if t.handle != C_NULL
170173
if t.isopen
171-
@atomic :monotonic t.isopen = false
174+
@atomic :release t.isopen = false
172175
ccall(:jl_close_uv, Cvoid, (Ptr{Cvoid},), t)
173176
end
174177
# implement _trywait here without the auto-reset function, just waiting for the final close signal
@@ -186,6 +189,8 @@ function close(t::Union{Timer, AsyncCondition})
186189
unlock(t.cond)
187190
unpreserve_handle(t)
188191
end
192+
elseif t.isopen
193+
@atomic :release t.isopen = false
189194
end
190195
iolock_end()
191196
nothing
@@ -198,8 +203,8 @@ function uvfinalize(t::Union{Timer, AsyncCondition})
198203
if t.handle != C_NULL
199204
disassociate_julia_struct(t.handle) # not going to call the usual close hooks anymore
200205
if t.isopen
201-
@atomic :monotonic t.isopen = false
202-
ccall(:jl_close_uv, Cvoid, (Ptr{Cvoid},), t.handle)
206+
@atomic :release t.isopen = false
207+
ccall(:jl_close_uv, Cvoid, (Ptr{Cvoid},), t.handle) # this will call Libc.free
203208
end
204209
@atomic :monotonic t.handle = C_NULL
205210
notify(t.cond, false)
@@ -214,8 +219,10 @@ end
214219
function _uv_hook_close(t::Union{Timer, AsyncCondition})
215220
lock(t.cond)
216221
try
217-
@atomic :monotonic t.isopen = false
218-
Libc.free(@atomicswap :monotonic t.handle = C_NULL)
222+
handle = t.handle
223+
@atomic :release t.isopen = false
224+
@atomic :monotonic t.handle = C_NULL
225+
Libc.free(handle)
219226
notify(t.cond, false)
220227
finally
221228
unlock(t.cond)
@@ -243,7 +250,7 @@ function uv_timercb(handle::Ptr{Cvoid})
243250
if ccall(:uv_timer_get_repeat, UInt64, (Ptr{Cvoid},), t) == 0
244251
# timer is stopped now
245252
if t.isopen
246-
@atomic :monotonic t.isopen = false
253+
@atomic :release t.isopen = false
247254
ccall(:jl_close_uv, Cvoid, (Ptr{Cvoid},), t)
248255
end
249256
end

base/boot.jl

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -518,15 +518,12 @@ const undef = UndefInitializer()
518518
# empty vector constructor
519519
(self::Type{GenericMemory{kind,T,addrspace}})() where {T,kind,addrspace} = self(undef, 0)
520520

521+
memoryref(mem::GenericMemory) = memoryrefnew(mem)
522+
memoryref(mem::GenericMemory, i::Integer) = memoryrefnew(memoryrefnew(mem), Int(i), @_boundscheck)
523+
memoryref(ref::GenericMemoryRef, i::Integer) = memoryrefnew(ref, Int(i), @_boundscheck)
521524
GenericMemoryRef(mem::GenericMemory) = memoryref(mem)
522-
GenericMemoryRef(ref::GenericMemoryRef, i::Integer) = memoryref(ref, Int(i), @_boundscheck)
523-
GenericMemoryRef(mem::GenericMemory, i::Integer) = memoryref(memoryref(mem), Int(i), @_boundscheck)
524-
GenericMemoryRef{kind,<:Any,AS}(mem::GenericMemory{kind,<:Any,AS}) where {kind,AS} = memoryref(mem)
525-
GenericMemoryRef{kind,<:Any,AS}(ref::GenericMemoryRef{kind,<:Any,AS}, i::Integer) where {kind,AS} = memoryref(ref, Int(i), @_boundscheck)
526-
GenericMemoryRef{kind,<:Any,AS}(mem::GenericMemory{kind,<:Any,AS}, i::Integer) where {kind,AS} = memoryref(memoryref(mem), Int(i), @_boundscheck)
527-
GenericMemoryRef{kind,T,AS}(mem::GenericMemory{kind,T,AS}) where {kind,T,AS} = memoryref(mem)
528-
GenericMemoryRef{kind,T,AS}(ref::GenericMemoryRef{kind,T,AS}, i::Integer) where {kind,T,AS} = memoryref(ref, Int(i), @_boundscheck)
529-
GenericMemoryRef{kind,T,AS}(mem::GenericMemory{kind,T,AS}, i::Integer) where {kind,T,AS} = memoryref(memoryref(mem), Int(i), @_boundscheck)
525+
GenericMemoryRef(mem::GenericMemory, i::Integer) = memoryref(mem, i)
526+
GenericMemoryRef(mem::GenericMemoryRef, i::Integer) = memoryref(mem, i)
530527

531528
const Memory{T} = GenericMemory{:not_atomic, T, CPU}
532529
const MemoryRef{T} = GenericMemoryRef{:not_atomic, T, CPU}
@@ -634,12 +631,12 @@ module IR
634631
export CodeInfo, MethodInstance, CodeInstance, GotoNode, GotoIfNot, ReturnNode,
635632
NewvarNode, SSAValue, SlotNumber, Argument,
636633
PiNode, PhiNode, PhiCNode, UpsilonNode, LineInfoNode,
637-
Const, PartialStruct, InterConditional, EnterNode
634+
Const, PartialStruct, InterConditional, EnterNode, memoryref
638635

639636
using Core: CodeInfo, MethodInstance, CodeInstance, GotoNode, GotoIfNot, ReturnNode,
640637
NewvarNode, SSAValue, SlotNumber, Argument,
641638
PiNode, PhiNode, PhiCNode, UpsilonNode, LineInfoNode,
642-
Const, PartialStruct, InterConditional, EnterNode
639+
Const, PartialStruct, InterConditional, EnterNode, memoryref
643640

644641
end # module IR
645642

base/compiler/optimize.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,7 @@ function iscall_with_boundscheck(@nospecialize(stmt), sv::PostOptAnalysisState)
677677
f === nothing && return false
678678
if f === getfield
679679
nargs = 4
680-
elseif f === memoryref || f === memoryrefget || f === memoryref_isassigned
680+
elseif f === memoryrefnew || f === memoryrefget || f === memoryref_isassigned
681681
nargs = 4
682682
elseif f === memoryrefset!
683683
nargs = 5

0 commit comments

Comments
 (0)