Skip to content

Commit c56093f

Browse files
simeonschaubLilithHafner
authored andcommitted
fix nothrow check for get_binding_type (JuliaLang#44229)
This got missed in JuliaLang#43671.
1 parent 9e477c0 commit c56093f

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

base/compiler/tfuncs.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1705,7 +1705,8 @@ function _builtin_nothrow(@nospecialize(f), argtypes::Array{Any,1}, @nospecializ
17051705
end
17061706
return false
17071707
elseif f === Core.get_binding_type
1708-
return length(argtypes) == 2
1708+
length(argtypes) == 2 || return false
1709+
return argtypes[1] Module && argtypes[2] Symbol
17091710
elseif f === donotdelete
17101711
return true
17111712
end

test/compiler/inference.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4028,3 +4028,5 @@ function f_boundscheck_elim(n)
40284028
ntuple(x->(@inbounds getfield(sin, x)), n)
40294029
end
40304030
@test Tuple{} <: code_typed(f_boundscheck_elim, Tuple{Int})[1][2]
4031+
4032+
@test !Core.Compiler.builtin_nothrow(Core.get_binding_type, Any[Rational{Int}, Core.Const(:foo)], Any)

0 commit comments

Comments
 (0)