From 76e5d3829c4ba784e5d2459894d8c7c6ce8fcce0 Mon Sep 17 00:00:00 2001 From: Karoliine Holter Date: Tue, 9 Jan 2024 13:53:00 +0200 Subject: [PATCH] Avoid doing Analyses.ask_of_ctx ctx for each exp in a list --- src/analyses/base.ml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/analyses/base.ml b/src/analyses/base.ml index 81e4591123..e77e3ac95c 100644 --- a/src/analyses/base.ml +++ b/src/analyses/base.ml @@ -1875,8 +1875,9 @@ struct (** From a list of expressions, collect a list of addresses that they might point to, or contain pointers to. *) let collect_funargs ~ctx ?(warn=false) (st:store) (exps: exp list) = + let ask = Analyses.ask_of_ctx ctx in let do_exp e = - let immediately_reachable = reachable_from_value (Analyses.ask_of_ctx ctx) (eval_rv ~ctx st e) (Cilfacade.typeOf e) (CilType.Exp.show e) in + let immediately_reachable = reachable_from_value ask (eval_rv ~ctx st e) (Cilfacade.typeOf e) (CilType.Exp.show e) in reachable_vars ~ctx st [immediately_reachable] in List.concat_map do_exp exps