Skip to content

Commit ecf41b1

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

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
@@ -337,7 +337,8 @@ macro _noub_meta()
337337
#=:inaccessiblememonly=#false,
338338
#=:noub=#true,
339339
#=:noub_if_noinbounds=#false,
340-
#=:consistent_overlay=#false))
340+
#=:consistent_overlay=#false,
341+
#=:nortcall=#false))
341342
end
342343
# can be used in place of `@assume_effects :notaskstate` (supposed to be used for bootstrapping)
343344
macro _notaskstate_meta()

src/method.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,8 @@ jl_code_info_t *jl_new_code_info_from_ir(jl_expr_t *ir)
491491
if (consistent_overlay) li->purity.overrides.ipo_consistent_overlay = consistent_overlay;
492492
int8_t nortcall = jl_unbox_bool(jl_exprarg(ma, 10));
493493
if (nortcall) li->purity.overrides.ipo_nortcall = nortcall;
494+
} else {
495+
assert(jl_expr_nargs(ma) == 0);
494496
}
495497
}
496498
else

test/compiler/effects.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -810,7 +810,12 @@ end
810810
# @test !Core.Compiler.is_nothrow(effects)
811811
# end
812812
#end
813-
#
813+
814+
@test Core.Compiler.is_noub(Base.infer_effects(Base._growbeg!, (Vector{Int}, Int)))
815+
@test Core.Compiler.is_noub(Base.infer_effects(Base._growbeg!, (Vector{Any}, Int)))
816+
@test Core.Compiler.is_noub(Base.infer_effects(Base._growend!, (Vector{Int}, Int)))
817+
@test Core.Compiler.is_noub(Base.infer_effects(Base._growend!, (Vector{Any}, Int)))
818+
814819
# tuple indexing
815820
# --------------
816821

0 commit comments

Comments
 (0)