Skip to content

Commit

Permalink
Remove the unused parameters ask, gs and st from query_evalint
Browse files Browse the repository at this point in the history
  • Loading branch information
karoliineh committed Dec 27, 2023
1 parent 1b617af commit dc6527c
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/analyses/base.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1088,7 +1088,7 @@ struct
with IntDomain.ArithmeticOnIntegerBot _ ->
ValueDomain.Compound.top_value (Cilfacade.typeOf exp)

let query_evalint ~ctx ask gs st e =
let query_evalint ~ctx e =
if M.tracing then M.traceli "evalint" "base query_evalint %a\n" d_exp e;
let r = match eval_rv_no_ask_evalint ~ctx e with
| Int i -> `Lifted i (* cast should be unnecessary, eval_rv should guarantee right ikind already *)
Expand All @@ -1110,12 +1110,10 @@ struct
if Queries.Set.mem anyq asked then
Queries.Result.top q (* query cycle *)
else (
let asked' = Queries.Set.add anyq asked in
match q with
| EvalInt e -> query_evalint ~ctx (ask asked') gs st e (* mimic EvalInt query since eval_rv needs it *)
| EvalInt e -> query_evalint ~ctx e (* mimic EvalInt query since eval_rv needs it *)
| _ -> Queries.Result.top q
)
and ask asked = { Queries.f = fun (type a) (q: a Queries.t) -> query asked q } (* our version of ask *)
and gs = function `Left _ -> `Lifted1 (Priv.G.top ()) | `Right _ -> `Lifted2 (VD.top ()) (* the expression is guaranteed to not contain globals *)
and ctx =
{ ask = (fun (type a) (q: a Queries.t) -> query Queries.Set.empty q)
Expand Down Expand Up @@ -1269,7 +1267,7 @@ struct
JmpBufDomain.JmpBufSet.top ()
end
| Q.EvalInt e ->
query_evalint ~ctx ask ctx.global ctx.local e
query_evalint ~ctx e
| Q.EvalMutexAttr e -> begin
let e:exp = Lval (Cil.mkMem ~addr:e ~off:NoOffset) in
match eval_rv ~ctx e with
Expand Down

0 comments on commit dc6527c

Please sign in to comment.