Skip to content

Commit

Permalink
partially fix InferenceResult cache lookup verification
Browse files Browse the repository at this point in the history
  • Loading branch information
jrevels committed Apr 18, 2018
1 parent 9d620dc commit 415b59f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions base/compiler/inferenceresult.jl
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,16 @@ end

function cache_lookup(code::MethodInstance, argtypes::Vector{Any}, cache::Vector{InferenceResult})
method = code.def::Method
nargs = method.nargs::Int
for cache_code in cache
# try to search cache first
cache_args = cache_code.args
if cache_code.linfo === code && length(cache_args) == length(argtypes)
if cache_code.linfo === code && length(cache_args) === nargs
cache_match = true
for i in 1:length(argtypes)
# TODO: Figure out easy + correct way to also verify `cache_code.vargs` and
# `cache_args[nargs]` without redundantly computing `vararg_type_vec` and
# `vararg_type` (from `get_argtypes` implementation above)
for i in 1:(nargs - 1)
a = argtypes[i]
ca = cache_args[i]
# verify that all Const argument types match between the call and cache
Expand Down

0 comments on commit 415b59f

Please sign in to comment.