Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
aviatesk committed Jul 30, 2021
1 parent 4890082 commit 485f1e7
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions src/abstractinterpretation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -185,16 +185,24 @@ end # @static if isdefined(CC, :find_matching_methods)
function CC.abstract_call_method_with_const_args(analyzer::AbstractAnalyzer, result::MethodCallResult,
@nospecialize(f), argtypes::Vector{Any}, match::MethodMatch,
sv::InferenceState, va_override::Bool)
result, inf_result = @invoke abstract_call_method_with_const_args(analyzer::AbstractInterpreter, result::MethodCallResult,
@nospecialize(f), argtypes::Vector{Any}, match::MethodMatch,
sv::InferenceState, va_override::Bool)

if isa(inf_result, InferenceResult)
# successful constant prop', we also need to update reports
update_reports!(analyzer, sv)
const_result =
@invoke abstract_call_method_with_const_args(analyzer::AbstractInterpreter, result::MethodCallResult,
@nospecialize(f), argtypes::Vector{Any}, match::MethodMatch,
sv::InferenceState, va_override::Bool)
# update reports if constant prop' was successful
# branch on https://github.com/JuliaLang/julia/pull/41697/
@static if VERSION v"1.8.0-DEV.282"
if const_result !== nothing
# successful constant prop', we also need to update reports
update_reports!(analyzer, sv)
end
else
if getfield(const_result, 2) !== nothing
# successful constant prop', we also need to update reports
update_reports!(analyzer, sv)
end
end

return result, inf_result
return const_result
end

@doc """
Expand Down

0 comments on commit 485f1e7

Please sign in to comment.