Skip to content

Commit a9fd6db

Browse files
topolarityaviatesk
authored andcommitted
effects: fix Base.@_noub_meta (#56061)
This had the incorrect number of arguments to `Expr(:purity, ...)` causing it to be silently ignored.
1 parent 794ec9d commit a9fd6db

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

base/essentials.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,8 @@ macro _noub_meta()
348348
#=:inaccessiblememonly=#false,
349349
#=:noub=#true,
350350
#=:noub_if_noinbounds=#false,
351-
#=:consistent_overlay=#false))
351+
#=:consistent_overlay=#false,
352+
#=:nortcall=#false))
352353
end
353354
# can be used in place of `@assume_effects :notaskstate` (supposed to be used for bootstrapping)
354355
macro _notaskstate_meta()

src/method.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,8 @@ static void jl_code_info_set_ir(jl_code_info_t *li, jl_expr_t *ir)
370370
if (consistent_overlay) li->purity.overrides.ipo_consistent_overlay = consistent_overlay;
371371
int8_t nortcall = jl_unbox_bool(jl_exprarg(ma, 10));
372372
if (nortcall) li->purity.overrides.ipo_nortcall = nortcall;
373+
} else {
374+
assert(jl_expr_nargs(ma) == 0);
373375
}
374376
}
375377
else

test/compiler/effects.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,12 @@ end
858858
# @test !Core.Compiler.is_nothrow(effects)
859859
# end
860860
#end
861-
#
861+
862+
@test Core.Compiler.is_noub(Base.infer_effects(Base._growbeg!, (Vector{Int}, Int)))
863+
@test Core.Compiler.is_noub(Base.infer_effects(Base._growbeg!, (Vector{Any}, Int)))
864+
@test Core.Compiler.is_noub(Base.infer_effects(Base._growend!, (Vector{Int}, Int)))
865+
@test Core.Compiler.is_noub(Base.infer_effects(Base._growend!, (Vector{Any}, Int)))
866+
862867
# tuple indexing
863868
# --------------
864869

0 commit comments

Comments
 (0)