Skip to content

Commit 8a037d6

Browse files
committed
Add TODOs for other uses of Queries.eval_bool
1 parent 095b170 commit 8a037d6

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

src/analyses/abortUnless.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ struct
3030
if man.local then
3131
match f.sformals with
3232
| [arg] when isIntegralType arg.vtype ->
33-
(match man.ask (EvalInt (Lval (Var arg, NoOffset))) with
33+
(match man.ask (EvalInt (Lval (Var arg, NoOffset))) with (* TODO: Queries.eval_bool? *)
3434
| v when Queries.ID.is_bot v -> false
3535
| v ->
3636
match Queries.ID.to_bool v with

src/analyses/memLeak.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ struct
228228
warn_for_multi_threaded_due_to_abort man;
229229
state
230230
| Assert { exp; _ } ->
231-
begin match man.ask (Queries.EvalInt exp) with
231+
begin match man.ask (Queries.EvalInt exp) with (* TODO: Queries.eval_bool? *)
232232
| a when Queries.ID.is_bot a -> M.warn ~category:Assert "assert expression %a is bottom" d_exp exp
233233
| a ->
234234
begin match Queries.ID.to_bool a with

src/analyses/unassumeAnalysis.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ struct
261261
let e = List.fold_left (fun a {exp = b; _} -> Cil.(BinOp (LAnd, a, b, intType))) x.exp xs in
262262
M.info ~category:Witness "unassume invariant: %a" CilType.Exp.pretty e;
263263
if not !AnalysisState.postsolving then (
264-
if not (GobConfig.get_bool "ana.unassume.precheck" && Queries.ID.to_bool (man.ask (EvalInt e)) = Some false) then (
264+
if not (GobConfig.get_bool "ana.unassume.precheck" && Queries.ID.to_bool (man.ask (EvalInt e)) = Some false) then ( (* TODO: Queries.eval_bool? *)
265265
let tokens = x.token :: List.map (fun {token; _} -> token) xs in
266266
man.emit (Unassume {exp = e; tokens});
267267
List.iter WideningTokenLifter.add tokens
@@ -280,7 +280,7 @@ struct
280280
let body man fd =
281281
let pres = FH.find_all fun_pres fd in
282282
let st = List.fold_left (fun acc pre ->
283-
let v = man.ask (EvalInt pre) in
283+
let v = man.ask (EvalInt pre) in (* TODO: Queries.eval_bool? *)
284284
(* M.debug ~category:Witness "%a precondition %a evaluated to %a" CilType.Fundec.pretty fd CilType.Exp.pretty pre Queries.ID.pretty v; *)
285285
if Queries.ID.to_bool v = Some true then
286286
D.add pre acc

src/transform/expressionEvaluation.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ struct
125125
value_after
126126

127127
method private try_ask location expression =
128-
match ~? (fun () -> (ask location).Queries.f (Queries.EvalInt expression)) with
128+
match ~? (fun () -> (ask location).Queries.f (Queries.EvalInt expression)) with (* TODO: Queries.eval_bool? *)
129129
(* Inapplicable: Unreachable *)
130130
| Some x when Queries.ID.is_bot_ikind x -> None
131131
| Some x ->

src/witness/yamlWitness.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ struct
454454
| `Lifted c_inv ->
455455
(* Collect all start states that may satisfy the invariant of current_c *)
456456
List.iter (fun c ->
457-
let x = R.ask_local (c.node, c.context) ~local:c.state (Queries.EvalInt c_inv) in
457+
let x = R.ask_local (c.node, c.context) ~local:c.state (Queries.EvalInt c_inv) in (* TODO: Queries.eval_bool? *)
458458
if Queries.ID.is_bot x || Queries.ID.is_bot_ikind x then (* dead code *)
459459
failwith "Bottom not expected when querying context state" (* Maybe this is reachable, failwith for now so we see when this happens *)
460460
else if Queries.ID.to_bool x = Some false then () (* Nothing to do, the c does definitely not satisfy the predicate of current_c *)
@@ -747,7 +747,7 @@ struct
747747

748748
let result: VR.result = match InvariantParser.parse_cil inv_parser ~fundec ~loc inv_cabs with
749749
| Ok inv_exp ->
750-
let x = ask_local lvar (Queries.EvalInt inv_exp) in
750+
let x = ask_local lvar (Queries.EvalInt inv_exp) in (* TODO: Queries.eval_bool? *)
751751
if Queries.ID.is_bot x || Queries.ID.is_bot_ikind x then (* dead code *)
752752
Option.get (VR.result_of_enum (VR.bot ()))
753753
else (
@@ -859,7 +859,7 @@ struct
859859

860860
match InvariantParser.parse_cil inv_parser ~fundec ~loc pre_cabs with
861861
| Ok pre_exp ->
862-
let x = ask_local pre_lvar (Queries.EvalInt pre_exp) in
862+
let x = ask_local pre_lvar (Queries.EvalInt pre_exp) in (* TODO: Queries.eval_bool? *)
863863
if Queries.ID.is_bot x || Queries.ID.is_bot_ikind x then (* dead code *)
864864
true
865865
else (

0 commit comments

Comments
 (0)