From 02a7dd7349fd89a8d17385c6aa8be5601cb4a256 Mon Sep 17 00:00:00 2001 From: Sungkeun Cho Date: Wed, 14 Apr 2021 10:22:02 -0700 Subject: [PATCH] [ConfigImpact] Fix a bug on analyzing fields of configs Summary: When a field is assigned by a value, ``` _.field = exp; ``` it should collect the field when the abstract config value of `exp` is non-bottom, rather than non-top. Reviewed By: ezgicicek Differential Revision: D27766188 fbshipit-source-id: a0b1f2c28 --- infer/src/cost/ConfigImpactAnalysis.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infer/src/cost/ConfigImpactAnalysis.ml b/infer/src/cost/ConfigImpactAnalysis.ml index daf74c9fd..91558952a 100644 --- a/infer/src/cost/ConfigImpactAnalysis.ml +++ b/infer/src/cost/ConfigImpactAnalysis.ml @@ -294,7 +294,7 @@ module Dom = struct let store_field fn id ({mem; config_fields} as astate) = let {Val.config} = Mem.lookup (Loc.of_id id) mem in - if ConfigLifted.is_top config then astate + if ConfigLifted.is_bottom config then astate else {astate with config_fields= Fields.add fn config_fields}