Skip to content

Commit

Permalink
effects: fix Base.@_noub_meta (#56061)
Browse files Browse the repository at this point in the history
This had the incorrect number of arguments to `Expr(:purity, ...)`
causing it to be silently ignored.
  • Loading branch information
topolarity authored Oct 9, 2024
1 parent 5117d04 commit ecf41b1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
3 changes: 2 additions & 1 deletion base/essentials.jl
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,8 @@ macro _noub_meta()
#=:inaccessiblememonly=#false,
#=:noub=#true,
#=:noub_if_noinbounds=#false,
#=:consistent_overlay=#false))
#=:consistent_overlay=#false,
#=:nortcall=#false))
end
# can be used in place of `@assume_effects :notaskstate` (supposed to be used for bootstrapping)
macro _notaskstate_meta()
Expand Down
2 changes: 2 additions & 0 deletions src/method.c
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,8 @@ jl_code_info_t *jl_new_code_info_from_ir(jl_expr_t *ir)
if (consistent_overlay) li->purity.overrides.ipo_consistent_overlay = consistent_overlay;
int8_t nortcall = jl_unbox_bool(jl_exprarg(ma, 10));
if (nortcall) li->purity.overrides.ipo_nortcall = nortcall;
} else {
assert(jl_expr_nargs(ma) == 0);
}
}
else
Expand Down
7 changes: 6 additions & 1 deletion test/compiler/effects.jl
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,12 @@ end
# @test !Core.Compiler.is_nothrow(effects)
# end
#end
#

@test Core.Compiler.is_noub(Base.infer_effects(Base._growbeg!, (Vector{Int}, Int)))
@test Core.Compiler.is_noub(Base.infer_effects(Base._growbeg!, (Vector{Any}, Int)))
@test Core.Compiler.is_noub(Base.infer_effects(Base._growend!, (Vector{Int}, Int)))
@test Core.Compiler.is_noub(Base.infer_effects(Base._growend!, (Vector{Any}, Int)))

# tuple indexing
# --------------

Expand Down

0 comments on commit ecf41b1

Please sign in to comment.