From 0f8111d0d048bf4016a8eb1462f92d08c6a2c3f5 Mon Sep 17 00:00:00 2001 From: Mehdi Bouaziz Date: Tue, 29 May 2018 10:10:32 -0700 Subject: [PATCH] OneInstrPerNode: fix preds Summary: Rely on the underlying CFG preds: - perf: no need to append lists - correctness: the underlying CFG may be removing duplicates Reviewed By: ngorogiannis Differential Revision: D8185638 fbshipit-source-id: 3b6f70a --- infer/src/absint/ProcCfg.ml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/infer/src/absint/ProcCfg.ml b/infer/src/absint/ProcCfg.ml index 87474f8e2..bb807ea9b 100644 --- a/infer/src/absint/ProcCfg.ml +++ b/infer/src/absint/ProcCfg.ml @@ -324,7 +324,9 @@ struct if index >= 1 then [] else List.map ~f:last_of_node (Base.exceptional_preds cfg node) - let preds cfg t = List.rev_append (exceptional_preds cfg t) (normal_preds cfg t) + let preds cfg (node, index) = + if index >= 1 then [(node, index - 1)] else List.map ~f:last_of_node (Base.preds cfg node) + let start_node cfg = first_of_node (Base.start_node cfg)