From 384b3c57985569bb8f52416712f8d3d358eaa94d Mon Sep 17 00:00:00 2001 From: Radu Grigore Date: Fri, 21 Jun 2019 04:09:28 -0700 Subject: [PATCH] Assert that there is at most one flowgraph per procedure name. Reviewed By: jvillard Differential Revision: D15695839 fbshipit-source-id: 979531edb --- infer/src/IR/Cfg.ml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/infer/src/IR/Cfg.ml b/infer/src/IR/Cfg.ml index 57c5e1afd..5d73f43fa 100644 --- a/infer/src/IR/Cfg.ml +++ b/infer/src/IR/Cfg.ml @@ -33,7 +33,10 @@ let get_all_defined_proc_names cfg = (** Create a new procdesc *) let create_proc_desc cfg (proc_attributes : ProcAttributes.t) = let pdesc = Procdesc.from_proc_attributes proc_attributes in - Typ.Procname.Hash.add cfg proc_attributes.proc_name pdesc ; + let pname = proc_attributes.proc_name in + if Typ.Procname.Hash.mem cfg pname then + L.die InternalError "Creating two procdescs for the same procname." ; + Typ.Procname.Hash.add cfg pname pdesc ; pdesc