@@ -136,9 +136,7 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f),
136136                end 
137137                tristate_merge! (sv, effects)
138138                push! (const_results, const_result)
139-                 if  const_result != =  nothing 
140-                     any_const_result =  true 
141-                 end 
139+                 any_const_result |=  const_result != =  nothing 
142140                this_rt =  tmerge (this_rt, rt)
143141                if  bail_out_call (interp, this_rt, sv)
144142                    break 
@@ -187,9 +185,7 @@ function abstract_call_gf_by_type(interp::AbstractInterpreter, @nospecialize(f),
187185            end 
188186            tristate_merge! (sv, effects)
189187            push! (const_results, const_result)
190-             if  const_result != =  nothing 
191-                 any_const_result =  true 
192-             end 
188+             any_const_result |=  const_result != =  nothing 
193189        end 
194190        @assert  ! (this_conditional isa  Conditional) " invalid lattice element returned from inter-procedural context" 
195191        seen +=  1 
@@ -704,12 +700,12 @@ function pure_eval_call(interp::AbstractInterpreter,
704700end 
705701function  _pure_eval_call (@nospecialize (f), arginfo:: ArgInfo )
706702    args =  collect_const_args (arginfo)
707-     try 
708-         value =  Core. _apply_pure (f, args)
709-         return  Const (value)
703+     value =  try 
704+         Core. _apply_pure (f, args)
710705    catch 
711706        return  nothing 
712707    end 
708+     return  Const (value)
713709end 
714710
715711function  concrete_eval_eligible (interp:: AbstractInterpreter ,
@@ -743,17 +739,18 @@ function concrete_eval_call(interp::AbstractInterpreter,
743739    @nospecialize (f), result:: MethodCallResult , arginfo:: ArgInfo , sv:: InferenceState )
744740    concrete_eval_eligible (interp, f, result, arginfo, sv) ||  return  nothing 
745741    args =  collect_const_args (arginfo)
746-     try 
747-         value =  Core. _call_in_world_total (get_world_counter (interp), f, args... )
748-         if  is_inlineable_constant (value) ||  call_result_unused (sv)
749-             #  If the constant is not inlineable, still do the const-prop, since the
750-             #  code that led to the creation of the Const may be inlineable in the same
751-             #  circumstance and may be optimizable.
752-             return  ConstCallResults (Const (value), ConstResult (result. edge, value), EFFECTS_TOTAL)
753-         end 
742+     world =  get_world_counter (interp)
743+     value =  try 
744+         Core. _call_in_world_total (world, f, args... )
754745    catch 
755746        #  The evaulation threw. By :consistent-cy, we're guaranteed this would have happened at runtime
756-         return  ConstCallResults (Union{}, ConstResult (result. edge), result. edge_effects)
747+         return  ConstCallResults (Union{}, ConstResult (result. edge, result. edge_effects), result. edge_effects)
748+     end 
749+     if  is_inlineable_constant (value) ||  call_result_unused (sv)
750+         #  If the constant is not inlineable, still do the const-prop, since the
751+         #  code that led to the creation of the Const may be inlineable in the same
752+         #  circumstance and may be optimizable.
753+         return  ConstCallResults (Const (value), ConstResult (result. edge, EFFECTS_TOTAL, value), EFFECTS_TOTAL)
757754    end 
758755    return  nothing 
759756end 
0 commit comments