From 4da601811a1ad41e1bc99985e2eb4fba0530d6b2 Mon Sep 17 00:00:00 2001 From: Valentin Perrelle <valentin.perrelle@cea.fr> Date: Mon, 7 Feb 2022 16:56:52 +0100 Subject: [PATCH] [Occurence] Use the new Eva API --- src/plugins/occurrence/register.ml | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/src/plugins/occurrence/register.ml b/src/plugins/occurrence/register.ml index 8d9d94741ec..cbf6feb7084 100644 --- a/src/plugins/occurrence/register.ml +++ b/src/plugins/occurrence/register.ml @@ -106,19 +106,21 @@ class occurrence = object (self) method! vlval lv = let ki = self#current_kinstr in - if Db.Value.is_accessible ki then begin - let z = !Db.Value.lval_to_zone ki lv in - try - Locations.Zone.fold_topset_ok - (fun b _ () -> - match b with - | Base.Var (vi, _) | Base.Allocated (vi, _, _) -> - Occurrences.add vi self#current_kf ki lv - | _ -> () - ) z () - with Abstract_interp.Error_Top -> - error ~current:true "Found completely imprecise value (%a). Ignoring@." - Printer.pp_lval lv + begin + match Eva.Results.(before_kinstr ki |> eval_address lv |> as_zone) with + | Result.Error _ -> (* ignore *) () + | Ok z -> + try + Locations.Zone.fold_topset_ok + (fun b _ () -> + match b with + | Base.Var (vi, _) | Base.Allocated (vi, _, _) -> + Occurrences.add vi self#current_kf ki lv + | _ -> () + ) z () + with Abstract_interp.Error_Top -> + error ~current:true "Found completely imprecise value (%a). Ignoring@." + Printer.pp_lval lv end; DoChildren @@ -135,7 +137,7 @@ class occurrence = object (self) Db.yield (); super#vstmt_aux s - initializer !Db.Value.compute () + initializer Eva.Analysis.compute () end -- GitLab