Skip to content

Commit 743578a

Browse files
authored
Fix effect override for @ccall (#46135)
1 parent 6009ae9 commit 743578a

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

base/compiler/abstractinterpretation.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2067,7 +2067,7 @@ function abstract_eval_statement(interp::AbstractInterpreter, @nospecialize(e),
20672067
override.consistent ? ALWAYS_TRUE : effects.consistent,
20682068
override.effect_free ? ALWAYS_TRUE : effects.effect_free,
20692069
override.nothrow ? ALWAYS_TRUE : effects.nothrow,
2070-
override.terminates_globally ? ALWAYS_TRUE : effects.terminates_globally,
2070+
override.terminates_globally ? ALWAYS_TRUE : effects.terminates,
20712071
effects.nonoverlayed ? true : false,
20722072
override.notaskstate ? ALWAYS_TRUE : effects.notaskstate)
20732073
end

test/compiler/effects.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,3 +182,8 @@ end |> !Core.Compiler.is_nothrow
182182
@test Base.infer_effects() do
183183
Core.svec(nothing, 1, "foo")
184184
end |> Core.Compiler.is_consistent
185+
186+
# issue 46122: @assume_effects for @ccall
187+
@test Base.infer_effects((Vector{Int},)) do a
188+
Base.@assume_effects :effect_free @ccall jl_array_ptr(a::Any)::Ptr{Int}
189+
end |> Core.Compiler.is_effect_free

0 commit comments

Comments
 (0)