Skip to content

Commit

Permalink
fix nothrow check for get_binding_type (JuliaLang#44229)
Browse files Browse the repository at this point in the history
This got missed in JuliaLang#43671.
  • Loading branch information
simeonschaub authored and LilithHafner committed Mar 8, 2022
1 parent 9e477c0 commit c56093f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion base/compiler/tfuncs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1705,7 +1705,8 @@ function _builtin_nothrow(@nospecialize(f), argtypes::Array{Any,1}, @nospecializ
end
return false
elseif f === Core.get_binding_type
return length(argtypes) == 2
length(argtypes) == 2 || return false
return argtypes[1] Module && argtypes[2] Symbol
elseif f === donotdelete
return true
end
Expand Down
2 changes: 2 additions & 0 deletions test/compiler/inference.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4028,3 +4028,5 @@ function f_boundscheck_elim(n)
ntuple(x->(@inbounds getfield(sin, x)), n)
end
@test Tuple{} <: code_typed(f_boundscheck_elim, Tuple{Int})[1][2]

@test !Core.Compiler.builtin_nothrow(Core.get_binding_type, Any[Rational{Int}, Core.Const(:foo)], Any)

0 comments on commit c56093f

Please sign in to comment.