Skip to content

Commit

Permalink
Count witness.invariant.flow_insensitive-as location invariants in su…
Browse files Browse the repository at this point in the history
…mmary
  • Loading branch information
sim642 committed Nov 29, 2024
1 parent 3369955 commit ffe255b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/witness/yamlWitness.ml
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ struct
fold_flow_insensitive_as_location ~inv (fun ~location ~inv acc ->
let invariant = Entry.invariant (CilType.Exp.show inv) in
let entry = Entry.location_invariant ~task ~location ~invariant in
incr cnt_location_invariant;
entry :: acc
) acc
| `Lifted _, _
Expand Down Expand Up @@ -605,6 +606,7 @@ struct
fold_flow_insensitive_as_location ~inv (fun ~location ~inv acc ->
let invariant = CilType.Exp.show inv in
let invariant = Entry.location_invariant' ~location ~invariant in
incr cnt_location_invariant;
invariant :: acc
) acc
| `Bot | `Top -> (* global bot might only be possible for alloc variables, if at all, so emit nothing *)
Expand Down
2 changes: 1 addition & 1 deletion tests/regression/13-privatized/04-priv_multi.t
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ Flow-insensitive invariants as location invariants.
[Warning][Deadcode][CWE-571] condition '1' (possibly inserted by CIL) is always true (04-priv_multi.c:45:10-45:11)
[Warning][Deadcode][CWE-571] condition 'B > 0' is always true (04-priv_multi.c:47:9-47:14)
[Info][Witness] witness generation summary:
location invariants: 0
location invariants: 9
loop invariants: 0
flow-insensitive invariants: 0
total generation entries: 10
Expand Down
4 changes: 2 additions & 2 deletions tests/regression/13-privatized/74-mutex.t
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ Flow-insensitive invariants as location invariants.
total lines: 15
[Warning][Deadcode][CWE-571] condition '1' (possibly inserted by CIL) is always true (74-mutex.c:19:10-19:11)
[Info][Witness] witness generation summary:
location invariants: 0
location invariants: 2
loop invariants: 0
flow-insensitive invariants: 0
total generation entries: 3
Expand Down Expand Up @@ -177,7 +177,7 @@ Same with ghost_instrumentation and invariant_set entries.
total lines: 15
[Warning][Deadcode][CWE-571] condition '1' (possibly inserted by CIL) is always true (74-mutex.c:19:10-19:11)
[Info][Witness] witness generation summary:
location invariants: 0
location invariants: 2
loop invariants: 0
flow-insensitive invariants: 0
total generation entries: 2
Expand Down

0 comments on commit ffe255b

Please sign in to comment.