From e3db5720cec046e9585a91c8aad13f5867806664 Mon Sep 17 00:00:00 2001 From: Mehdi Bouaziz Date: Thu, 28 Feb 2019 03:35:00 -0800 Subject: [PATCH] [Cost] Always call substitute to record trace element Summary: : Since traces are attached to symbols, currently it will make no difference. Calling `subst` on `Top` or on constant is constant-time. But I need this to record `Call` trace elements for `Top`. Reviewed By: ezgicicek Differential Revision: D14249265 fbshipit-source-id: d3aa4ac9e --- infer/src/checkers/cost.ml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/infer/src/checkers/cost.ml b/infer/src/checkers/cost.ml index 184780ab4..cf39558fe 100644 --- a/infer/src/checkers/cost.ml +++ b/infer/src/checkers/cost.ml @@ -574,10 +574,8 @@ module InstrBasicCost = struct match get_callee_summary pdesc callee_pname with | Some ({CostDomain.post= callee_cost_record}, callee_formals) -> CostDomain.map callee_cost_record ~f:(fun callee_cost -> - if BasicCost.is_symbolic callee_cost then - instantiate_cost integer_type_widths ~inferbo_caller_mem:inferbo_mem - ~callee_pname ~callee_formals ~params ~callee_cost ~loc - else callee_cost ) + instantiate_cost integer_type_widths ~inferbo_caller_mem:inferbo_mem + ~callee_pname ~callee_formals ~params ~callee_cost ~loc ) | None -> CostDomain.unit_cost_atomic_operation ) ) ) | Sil.Load _ | Sil.Store _ | Sil.Call _ | Sil.Prune _ ->