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

Backports for 1.11.0-rc1 #54611

Merged
merged 71 commits into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
84bde3f
typeintersect: fix incorrect innervar handling under circular env (#5…
N5N3 May 28, 2024
862f863
[backport] v1.11: mark Lockable as `public` and update NEWS.md for Lo…
ericphanson May 29, 2024
0df6f80
[LBT] Upgrade to v5.9.0 (#54361)
amontoison May 5, 2024
b1a30d2
CLI: Use `GetModuleHandleExW` to locate libjulia.dll (#54617)
topolarity May 29, 2024
9e2cb49
Allow libquadmath to also fail as it is not available on all systems …
ViralBShah May 30, 2024
166a82c
ensure we set the right value to gc_first_tid (#54645)
d-netto May 31, 2024
7ed2a6d
Construct LazyString in error paths for tridiag (#54648)
jishnub Jun 4, 2024
2cea685
inference: fix too conservative effects for recursive cycles (#54323)
aviatesk Jun 5, 2024
c0f71e7
inference: follow up #54323, override ssaflags with new cycle effects…
aviatesk Jun 7, 2024
92f5aa5
Switch to Pkg mode prompt immediately and load Pkg in the background …
IanButterworth Jun 4, 2024
10c2e64
Improve error message in inplace transpose (#54669)
jishnub Jun 4, 2024
9353607
Add boundscheck in bindingkey_eq to avoid OOB access due to data race…
gbaraldi Jun 5, 2024
60cc3ab
make: Fix `sed` command for LLVM libraries with no symbol versioning …
topolarity Jun 5, 2024
77f4bc6
LazyString in reinterpretarray error messages (#54704)
jishnub Jun 7, 2024
05f40c3
make `AbstractPipe` public (#54191)
LilithHafner May 23, 2024
207ada2
Aggressive constprop in trevc! to stabilize triangular eigvec (#54635)
jishnub May 31, 2024
26053dc
make elsize public (#54554)
LilithHafner May 31, 2024
baf763d
fix missing uuid check on extension when finding the location of an e…
KristofferC Jun 4, 2024
ddd5c28
Rename at-scriptdir project argument to at-script and search upwards …
oxinabox May 28, 2024
4bc3d07
Fixes for bitcast bugs with LLVM 17 / opaque pointers (#54548)
maleadt May 22, 2024
6b4b5ef
Add `jl_getaffinity` and `jl_setaffinity` (#53402)
carstenbauer May 25, 2024
90acf2a
Set storage class of julia globals to dllimport on windows to avoid a…
gbaraldi May 29, 2024
45b38b3
more precise aliasing checks for SubArray (#54624)
mbauman Jun 5, 2024
5b3a5e4
🤖 [master] Bump the Distributed stdlib from 6a07d98 to 6c7cdb5 (#54679)
DilumAluthgeBot Jun 5, 2024
bab6633
Fix tbaa annotation on union selector bytes inside of structs (#54604)
gbaraldi Jun 5, 2024
e8662da
Fix assertion/crash when optimizing function with dead basic block (#…
gbaraldi Jun 6, 2024
0653044
Unalias source from dest in copytrito (#54474)
jishnub May 15, 2024
d07a863
Accomodate for rectangular matrices in `copytrito!` (#54587)
dkarrasch May 29, 2024
b69fc57
Backport "Avoid concatenating LazyString in setindex! for triangular …
jishnub Jun 10, 2024
c057940
Don't test with opaque pointers
gbaraldi Jun 10, 2024
4d53a38
Fix trampoline assembly for build on clang 18 on apple silicon (#54634)
gbaraldi May 30, 2024
fe51261
fix prepend StackOverflow issue (#54718)
vtjnash Jun 7, 2024
115d090
Reimplement dummy pkg prompt as standard prompt (#54674)
IanButterworth Jun 9, 2024
b7aed98
LazyString in interpolated error messages involving types (#54737)
jishnub Jun 10, 2024
90c432f
Document GenericMemory and AtomicMemory (#54642)
oscardssmith Jun 10, 2024
cfe9c49
make: use `readelf` for LLVM symbol version detection (#54713)
topolarity Jun 10, 2024
e6dd695
REPL: improve prompt! async function handler (#54760)
IanButterworth Jun 11, 2024
2dec97f
fix double-counting and non-deterministic results in `summarysize` (#…
JeffBezanson Jun 11, 2024
a6d098e
REPL: Fully populate the dummy Pkg prompt (#54759)
IanButterworth Jun 11, 2024
193fee8
lowering: Recognize argument destructuring inside macro hygiene (#54702)
Keno Jun 8, 2024
9874d82
Don't let setglobal! implicitly create bindings (#54678)
Keno Jun 8, 2024
63b66b8
Fix uuidkey of exts in fast path of `require_stdlib` (#54730)
IanButterworth Jun 9, 2024
95a3792
Handle no-postdominator case in finalizer pass (#54765)
topolarity Jun 13, 2024
592afcb
Don't expose guard pages to malloc_stack API consumers (#54591)
fingolfin Jun 9, 2024
5bccb82
TOML: Improve type-stability of BigInt/UInt support (#53955)
topolarity Apr 5, 2024
0211c83
[TOML] remove Dates hack, replace with explicit usage (#54755)
vtjnash Jun 13, 2024
d3e7b45
add try/catch around scheduler to reset sleep state (#54721)
vtjnash Jun 8, 2024
f41f896
bump Pkg to latest 1.11
Jun 13, 2024
8bdf1fa
effects: add new `@consistent_overlay` macro (#54322)
aviatesk Jun 18, 2024
6aba3b2
Revert "Test and fix non-int-length bug in `view(::Memory, ::Union{Un…
Jun 18, 2024
fc09c27
Revert "Make reshape and view on Memory produce Arrays and delete wra…
Jun 18, 2024
410cac7
REPL: spawn to avoid blocking typing, fix pkg repl transition sequenc…
IanButterworth Jun 18, 2024
0c06ae1
unexport wrap
Jun 19, 2024
1d4cf2c
REPL.prompt!: don't use Char peek (#54865)
IanButterworth Jun 21, 2024
31dac53
add sticky task warning to `@task` and `schedule` (#54815)
IanButterworth Jun 18, 2024
b04de54
REPL: fix projname when project_file is missing (#54795)
IanButterworth Jun 14, 2024
202151d
make recommendation clearer on manifest version mismatch (#54779)
IanButterworth Jun 13, 2024
ffb88e8
fix REPL prompt on 1.10
KristofferC Jun 22, 2024
dff9905
bump Pkg to latest v1.11
KristofferC Jun 22, 2024
06fdfd7
add missing compat entry to edit (#54769)
palday Jun 12, 2024
b12f4e1
[LinearAlgebra] Improve resilience to unknown libblastrampoline flags…
staticfloat Jun 13, 2024
639f62e
Add missing word in manifest warning (#54802)
christiangnrd Jun 14, 2024
83ff230
Artifacts: Change Dict{AbstractPlatform} to Dict{Platform} to reduce …
mkitti Jun 19, 2024
46d0705
fix var name in `reseteof(s::BufferStream)` (#54859)
IanButterworth Jun 21, 2024
82d961b
`nextind`, `prevind` doc strings: correct the Markdown (#54876)
nsajko Jun 22, 2024
cf4f1ba
serialization: fix relocatability bug (#54738)
vtjnash Jun 22, 2024
782386f
Revert "[LBT] Upgrade to v5.9.0 (#54361)"
KristofferC Jun 23, 2024
a88c638
Do not add type tag size to the `alloc_typed` lowering for GC allocat…
gbaraldi Jun 18, 2024
9cf8b19
Add openlibm to sysimg link line on windows (#53672)
Keno Jun 18, 2024
0db324c
mark failing double counting test as broken on i686-linux (#54896)
IanButterworth Jun 23, 2024
c644312
Fix calling LLVM_SIZE on windows (#53902)
Zentrik Apr 1, 2024
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
2 changes: 1 addition & 1 deletion Make.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1393,7 +1393,7 @@ ifeq ($(OS), WINNT)
HAVE_SSP := 1
OSLIBS += -Wl,--export-all-symbols -Wl,--version-script=$(BUILDROOT)/src/julia.expmap \
$(NO_WHOLE_ARCHIVE) -lpsapi -lkernel32 -lws2_32 -liphlpapi -lwinmm -ldbghelp -luserenv -lsecur32 -latomic -lole32
JLDFLAGS += -Wl,--stack,8388608
JLDFLAGS += -Wl,--stack,8388608 --disable-auto-import --disable-runtime-pseudo-reloc
ifeq ($(ARCH),i686)
JLDFLAGS += -Wl,--large-address-aware
endif
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ win-extras:
ifeq ($(USE_SYSTEM_LLVM), 1)
LLVM_SIZE := llvm-size$(EXE)
else
LLVM_SIZE := $(build_depsbindir)/llvm-size$(EXE)
LLVM_SIZE := PATH=$(build_bindir):$$PATH; $(build_depsbindir)/llvm-size$(EXE)
endif
build-stats:
ifeq ($(USE_BINARYBUILDER_LLVM),1)
Expand Down
4 changes: 3 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,13 @@ Command-line option changes
difference between defining a `main` function and executing the code directly at the end of the script ([#50974]).
* The `--compiled-modules` and `--pkgimages` flags can now be set to `existing`, which will
cause Julia to consider loading existing cache files, but not to create new ones ([#50586], [#52573]).
* The `--project` argument now accepts `@script` to give a path to a directory with a Project.toml relative to the passed script file. `--project=@script/foo` for the `foo` subdirectory. If no path is given after (i.e. `--project=@script`) then (like `--project=@.`) the directory and its parents are searched for a Project.toml ([#50864] and [#53352])

Multi-threading changes
-----------------------

* `Threads.@threads` now supports the `:greedy` scheduler, intended for non-uniform workloads ([#52096]).
* A new exported struct `Lockable{T, L<:AbstractLock}` makes it easy to bundle a resource and its lock together ([#52898]).
* A new public (but unexported) struct `Base.Lockable{T, L<:AbstractLock}` makes it easy to bundle a resource and its lock together ([#52898]).

New library functions
---------------------
Expand All @@ -87,6 +88,7 @@ New library functions
* `Sys.username()` can be used to return the current user's username ([#51897]).
* `Sys.isreadable(), Sys.iswritable()` can be used to check if the current user has access permissions
that permit reading and writing, respectively. ([#53320]).
* `wrap(Array, m::Union{MemoryRef{T}, Memory{T}}, dims)` is the safe counterpart to `unsafe_wrap` ([#52049]).
* `GC.logging_enabled()` can be used to test whether GC logging has been enabled via `GC.enable_logging` ([#51647]).
* `IdSet` is now exported from Base and considered public ([#53262]).
* `@time` now reports a count of any lock conflicts where a `ReentrantLock` had to wait, plus a new macro
Expand Down
21 changes: 11 additions & 10 deletions base/Enums.jl
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ end
# give Enum types scalar behavior in broadcasting
Base.broadcastable(x::Enum) = Ref(x)

@noinline enum_argument_error(typename, x) = throw(ArgumentError(string("invalid value for Enum $(typename): $x")))
@noinline enum_argument_error(typename, x) = throw(ArgumentError(LazyString("invalid value for Enum ", typename, ": ", x)))

"""
@enum EnumName[::BaseType] value1[=x] value2[=y]
Expand Down Expand Up @@ -143,18 +143,19 @@ julia> Symbol(apple)
"""
macro enum(T::Union{Symbol,Expr}, syms...)
if isempty(syms)
throw(ArgumentError("no arguments given for Enum $T"))
throw(ArgumentError(LazyString("no arguments given for Enum ", T)))
end
basetype = Int32
typename = T
if isa(T, Expr) && T.head === :(::) && length(T.args) == 2 && isa(T.args[1], Symbol)
typename = T.args[1]
basetype = Core.eval(__module__, T.args[2])
if !isa(basetype, DataType) || !(basetype <: Integer) || !isbitstype(basetype)
throw(ArgumentError("invalid base type for Enum $typename, $T=::$basetype; base type must be an integer primitive type"))
throw(ArgumentError(
LazyString("invalid base type for Enum ", typename, ", ", T, "=::", basetype, "; base type must be an integer primitive type")))
end
elseif !isa(T, Symbol)
throw(ArgumentError("invalid type expression for enum $T"))
throw(ArgumentError(LazyString("invalid type expression for enum ", T)))
end
values = Vector{basetype}()
seen = Set{Symbol}()
Expand All @@ -169,32 +170,32 @@ macro enum(T::Union{Symbol,Expr}, syms...)
s isa LineNumberNode && continue
if isa(s, Symbol)
if i == typemin(basetype) && !isempty(values)
throw(ArgumentError("overflow in value \"$s\" of Enum $typename"))
throw(ArgumentError(LazyString("overflow in value \"", s, "\" of Enum ", typename)))
end
elseif isa(s, Expr) &&
(s.head === :(=) || s.head === :kw) &&
length(s.args) == 2 && isa(s.args[1], Symbol)
i = Core.eval(__module__, s.args[2]) # allow exprs, e.g. uint128"1"
if !isa(i, Integer)
throw(ArgumentError("invalid value for Enum $typename, $s; values must be integers"))
throw(ArgumentError(LazyString("invalid value for Enum ", typename, ", ", s, "; values must be integers")))
end
i = convert(basetype, i)
s = s.args[1]
hasexpr = true
else
throw(ArgumentError(string("invalid argument for Enum ", typename, ": ", s)))
throw(ArgumentError(LazyString("invalid argument for Enum ", typename, ": ", s)))
end
s = s::Symbol
if !Base.isidentifier(s)
throw(ArgumentError("invalid name for Enum $typename; \"$s\" is not a valid identifier"))
throw(ArgumentError(LazyString("invalid name for Enum ", typename, "; \"", s, "\" is not a valid identifier")))
end
if hasexpr && haskey(namemap, i)
throw(ArgumentError("both $s and $(namemap[i]) have value $i in Enum $typename; values must be unique"))
throw(ArgumentError(LazyString("both ", s, " and ", namemap[i], " have value ", i, " in Enum ", typename, "; values must be unique")))
end
namemap[i] = s
push!(values, i)
if s in seen
throw(ArgumentError("name \"$s\" in Enum $typename is not unique"))
throw(ArgumentError(LazyString("name \"", s, "\" in Enum ", typename, " is not unique")))
end
push!(seen, s)
if length(values) == 1
Expand Down
4 changes: 2 additions & 2 deletions base/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,12 @@ endif
ifneq (,$(LIBGFORTRAN_VERSION))
$(eval $(call symlink_system_library,CSL,libgfortran,$(LIBGFORTRAN_VERSION)))
endif
$(eval $(call symlink_system_library,CSL,libquadmath,0))
$(eval $(call symlink_system_library,CSL,libstdc++,6))
# We allow libssp, libatomic and libgomp to fail as they are not available on all systems
# We allow libssp, libatomic, libgomp and libquadmath to fail as they are not available on all systems
$(eval $(call symlink_system_library,CSL,libssp,0,ALLOW_FAILURE))
$(eval $(call symlink_system_library,CSL,libatomic,1,ALLOW_FAILURE))
$(eval $(call symlink_system_library,CSL,libgomp,1,ALLOW_FAILURE))
$(eval $(call symlink_system_library,CSL,libquadmath,0,ALLOW_FAILURE))
$(eval $(call symlink_system_library,PCRE,libpcre2-8))
$(eval $(call symlink_system_library,DSFMT,libdSFMT))
$(eval $(call symlink_system_library,LIBBLASTRAMPOLINE,libblastrampoline))
Expand Down
16 changes: 9 additions & 7 deletions base/abstractarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ julia> checkindex(Bool, 1:20, 21)
false
```
"""
checkindex(::Type{Bool}, inds, i) = throw(ArgumentError("unable to check bounds for indices of type $(typeof(i))"))
checkindex(::Type{Bool}, inds, i) = throw(ArgumentError(LazyString("unable to check bounds for indices of type ", typeof(i))))
checkindex(::Type{Bool}, inds::AbstractUnitRange, i::Real) = (first(inds) <= i) & (i <= last(inds))
checkindex(::Type{Bool}, inds::IdentityUnitRange, i::Real) = checkindex(Bool, inds.indices, i)
checkindex(::Type{Bool}, inds::OneTo{T}, i::T) where {T<:BitInteger} = unsigned(i - one(i)) < unsigned(last(inds))
Expand Down Expand Up @@ -1519,12 +1519,14 @@ much more common case where aliasing does not occur. By default,
unaliascopy(A::Array) = copy(A)
unaliascopy(A::AbstractArray)::typeof(A) = (@noinline; _unaliascopy(A, copy(A)))
_unaliascopy(A::T, C::T) where {T} = C
_unaliascopy(A, C) = throw(ArgumentError("""
an array of type `$(typename(typeof(A)).wrapper)` shares memory with another argument
and must make a preventative copy of itself in order to maintain consistent semantics,
but `copy(::$(typeof(A)))` returns a new array of type `$(typeof(C))`.
To fix, implement:
`Base.unaliascopy(A::$(typename(typeof(A)).wrapper))::typeof(A)`"""))
function _unaliascopy(A, C)
Aw = typename(typeof(A)).wrapper
throw(ArgumentError(LazyString("an array of type `", Aw, "` shares memory with another argument ",
"and must make a preventative copy of itself in order to maintain consistent semantics, ",
"but `copy(::", typeof(A), ")` returns a new array of type `", typeof(C), "`.\n",
"""To fix, implement:
`Base.unaliascopy(A::""", Aw, ")::typeof(A)`")))
end
unaliascopy(A) = A

"""
Expand Down
61 changes: 55 additions & 6 deletions base/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1312,8 +1312,7 @@ end

append!(a::AbstractVector, iter) = _append!(a, IteratorSize(iter), iter)
push!(a::AbstractVector, iter...) = append!(a, iter)

append!(a::AbstractVector, iter...) = foldl(append!, iter, init=a)
append!(a::AbstractVector, iter...) = (for v in iter; append!(a, v); end; return a)

function _append!(a::AbstractVector, ::Union{HasLength,HasShape}, iter)
n = Int(length(iter))::Int
Expand Down Expand Up @@ -1372,10 +1371,9 @@ function prepend!(a::Vector{T}, items::Union{AbstractVector{<:T},Tuple}) where T
return a
end

prepend!(a::Vector, iter) = _prepend!(a, IteratorSize(iter), iter)
pushfirst!(a::Vector, iter...) = prepend!(a, iter)

prepend!(a::AbstractVector, iter...) = foldr((v, a) -> prepend!(a, v), iter, init=a)
prepend!(a::AbstractVector, iter) = _prepend!(a, IteratorSize(iter), iter)
pushfirst!(a::AbstractVector, iter...) = prepend!(a, iter)
prepend!(a::AbstractVector, iter...) = (for v = reverse(iter); prepend!(a, v); end; return a)

function _prepend!(a::Vector, ::Union{HasLength,HasShape}, iter)
@_terminates_locally_meta
Expand Down Expand Up @@ -3062,3 +3060,54 @@ intersect(r::AbstractRange, v::AbstractVector) = intersect(v, r)
_getindex(v, i)
end
end

"""
wrap(Array, m::Union{Memory{T}, MemoryRef{T}}, dims)

Create an array of size `dims` using `m` as the underlying memory. This can be thought of as a safe version
of [`unsafe_wrap`](@ref) utilizing `Memory` or `MemoryRef` instead of raw pointers.
"""
function wrap end

# validity checking for _wrap calls, separate from allocation of Array so that it can be more likely to inline into the caller
function _wrap(ref::MemoryRef{T}, dims::NTuple{N, Int}) where {T, N}
mem = ref.mem
mem_len = length(mem) + 1 - memoryrefoffset(ref)
len = Core.checked_dims(dims...)
@boundscheck mem_len >= len || invalid_wrap_err(mem_len, dims, len)
if N != 1 && !(ref === GenericMemoryRef(mem) && len === mem_len)
mem = ccall(:jl_genericmemory_slice, Memory{T}, (Any, Ptr{Cvoid}, Int), mem, ref.ptr_or_offset, len)
ref = MemoryRef(mem)
end
return ref
end

@noinline invalid_wrap_err(len, dims, proddims) = throw(DimensionMismatch(
"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."))

@eval @propagate_inbounds function wrap(::Type{Array}, m::MemoryRef{T}, dims::NTuple{N, Integer}) where {T, N}
dims = convert(Dims, dims)
ref = _wrap(m, dims)
$(Expr(:new, :(Array{T, N}), :ref, :dims))
end

@eval @propagate_inbounds function wrap(::Type{Array}, m::Memory{T}, dims::NTuple{N, Integer}) where {T, N}
dims = convert(Dims, dims)
ref = _wrap(MemoryRef(m), dims)
$(Expr(:new, :(Array{T, N}), :ref, :dims))
end
@eval @propagate_inbounds function wrap(::Type{Array}, m::MemoryRef{T}, l::Integer) where {T}
dims = (Int(l),)
ref = _wrap(m, dims)
$(Expr(:new, :(Array{T, 1}), :ref, :dims))
end
@eval @propagate_inbounds function wrap(::Type{Array}, m::Memory{T}, l::Integer) where {T}
dims = (Int(l),)
ref = _wrap(MemoryRef(m), (l,))
$(Expr(:new, :(Array{T, 1}), :ref, :dims))
end
@eval @propagate_inbounds function wrap(::Type{Array}, m::Memory{T}) where {T}
ref = MemoryRef(m)
dims = (length(m),)
$(Expr(:new, :(Array{T, 1}), :ref, :dims))
end
3 changes: 2 additions & 1 deletion base/boot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,8 @@ macro _foldable_meta()
#=:notaskstate=#true,
#=:inaccessiblememonly=#true,
#=:noub=#true,
#=:noub_if_noinbounds=#false))
#=:noub_if_noinbounds=#false,
#=:consistent_overlay=#false))
end

macro inline() Expr(:meta, :inline) end
Expand Down
2 changes: 1 addition & 1 deletion base/c.jl
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ function ccall_macro_lower(convention, func, rettype, types, args, nreq)
check = quote
if !isa(func, Ptr{Cvoid})
name = $name
throw(ArgumentError("interpolated function `$name` was not a Ptr{Cvoid}, but $(typeof(func))"))
throw(ArgumentError(LazyString("interpolated function `", name, "` was not a Ptr{Cvoid}, but ", typeof(func))))
end
end
push!(statements, check)
Expand Down
14 changes: 11 additions & 3 deletions base/compiler/abstractinterpretation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ function add_call_backedges!(interp::AbstractInterpreter, @nospecialize(rettype)
# ignore the `:nonoverlayed` property if `interp` doesn't use overlayed method table
# since it will never be tainted anyway
if !isoverlayed(method_table(interp))
all_effects = Effects(all_effects; nonoverlayed=false)
all_effects = Effects(all_effects; nonoverlayed=ALWAYS_FALSE)
end
all_effects === Effects() && return nothing
end
Expand Down Expand Up @@ -889,7 +889,15 @@ function concrete_eval_eligible(interp::AbstractInterpreter,
mi = result.edge
if mi !== nothing && is_foldable(effects)
if f !== nothing && is_all_const_arg(arginfo, #=start=#2)
if is_nonoverlayed(interp) || is_nonoverlayed(effects)
if (is_nonoverlayed(interp) || is_nonoverlayed(effects) ||
# Even if overlay methods are involved, when `:consistent_overlay` is
# explicitly applied, we can still perform concrete evaluation using the
# original methods for executing them.
# While there's a chance that the non-overlayed counterparts may raise
# non-egal exceptions, it will not impact the compilation validity, since:
# - the results of the concrete evaluation will not be inlined
# - the exception types from the concrete evaluation will not be propagated
is_consistent_overlay(effects))
return :concrete_eval
end
# disable concrete-evaluation if this function call is tainted by some overlayed
Expand Down Expand Up @@ -2770,7 +2778,7 @@ function override_effects(effects::Effects, override::EffectsOverride)
notaskstate = override.notaskstate ? true : effects.notaskstate,
inaccessiblememonly = override.inaccessiblememonly ? ALWAYS_TRUE : effects.inaccessiblememonly,
noub = override.noub ? ALWAYS_TRUE :
override.noub_if_noinbounds && effects.noub !== ALWAYS_TRUE ? NOUB_IF_NOINBOUNDS :
(override.noub_if_noinbounds && effects.noub !== ALWAYS_TRUE) ? NOUB_IF_NOINBOUNDS :
effects.noub)
end

Expand Down
11 changes: 7 additions & 4 deletions base/compiler/compiler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,11 @@ struct EffectsOverride
inaccessiblememonly::Bool
noub::Bool
noub_if_noinbounds::Bool
consistent_overlay::Bool
end
function EffectsOverride(
override::EffectsOverride =
EffectsOverride(false, false, false, false, false, false, false, false, false);
EffectsOverride(false, false, false, false, false, false, false, false, false, false);
consistent::Bool = override.consistent,
effect_free::Bool = override.effect_free,
nothrow::Bool = override.nothrow,
Expand All @@ -59,7 +60,8 @@ function EffectsOverride(
notaskstate::Bool = override.notaskstate,
inaccessiblememonly::Bool = override.inaccessiblememonly,
noub::Bool = override.noub,
noub_if_noinbounds::Bool = override.noub_if_noinbounds)
noub_if_noinbounds::Bool = override.noub_if_noinbounds,
consistent_overlay::Bool = override.consistent_overlay)
return EffectsOverride(
consistent,
effect_free,
Expand All @@ -69,9 +71,10 @@ function EffectsOverride(
notaskstate,
inaccessiblememonly,
noub,
noub_if_noinbounds)
noub_if_noinbounds,
consistent_overlay)
end
const NUM_EFFECTS_OVERRIDES = 9 # sync with julia.h
const NUM_EFFECTS_OVERRIDES = 10 # sync with julia.h

# essential files and libraries
include("essentials.jl")
Expand Down
Loading