Skip to content

Commit

Permalink
ensure in_typeinf_loop is only read by the thread with the typeinf lock
Browse files Browse the repository at this point in the history
(cherry picked from commit b6b26df)
ref #18094
  • Loading branch information
vtjnash authored and tkelman committed Aug 20, 2016
1 parent c776bbc commit 2cb13f3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion base/inference.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1469,7 +1469,11 @@ function typeinf_edge(method::Method, atypes::ANY, sparams::SimpleVector, needtr
end
end

if caller === nothing && in_typeinf_loop
ccall(:jl_typeinf_begin, Void, ())
thread_in_typeinf_loop = in_typeinf_loop::Bool
ccall(:jl_typeinf_end, Void, ())

if caller === nothing && thread_in_typeinf_loop
# if the caller needed the ast, but we are already in the typeinf loop
# then just return early -- we can't fulfill this request
# if the client was inlining, then this means we decided not to try to infer this
Expand Down

0 comments on commit 2cb13f3

Please sign in to comment.