From 8f8050ba3f552ab26f35e4d90ccf340fee5c0cc5 Mon Sep 17 00:00:00 2001 From: Nikos Gorogiannis Date: Tue, 12 Nov 2019 02:19:26 -0800 Subject: [PATCH] [call-graph scheduling] fix bug in node removal Summary: The order was wrong: the map from procnames to node-ids was cleaned first, but to clean the map from node-ids to nodes, we need the id and we have already removed it. The symptom was that effectively no new leaves are created by "removing" a node, so the call graph scheduler quickly devolves to the file-based one. Reviewed By: skcho Differential Revision: D18448209 fbshipit-source-id: f272a8112 --- infer/src/backend/CallGraph.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/infer/src/backend/CallGraph.ml b/infer/src/backend/CallGraph.ml index fd89e8f61..897852f7f 100644 --- a/infer/src/backend/CallGraph.ml +++ b/infer/src/backend/CallGraph.ml @@ -71,8 +71,8 @@ let n_procs {node_map} = NodeMap.length node_map let node_of_procname g pname = id_of_procname g pname |> Option.bind ~f:(node_of_id g) let remove (g : t) pname = - IdMap.remove g.id_map pname ; - id_of_procname g pname |> Option.iter ~f:(NodeMap.remove g.node_map) + id_of_procname g pname |> Option.iter ~f:(NodeMap.remove g.node_map) ; + IdMap.remove g.id_map pname let get_or_set_id ({id_map} as graph) procname =