File tree Expand file tree Collapse file tree
src/cdomain/value/domains Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5353 inv
5454 |> exp_deep_unroll_types
5555 |> InvariantCil. exp_replace_original_name
56+ |> InvariantCil. exp_remove_anon_comp_offset
5657 in
5758 if GobConfig. get_bool " witness.invariant.split-conjunction" then
5859 ES. elements (pullOutCommonConjuncts inv')
Original file line number Diff line number Diff line change @@ -17,6 +17,32 @@ let exp_replace_original_name =
1717 let visitor = new exp_replace_original_name_visitor in
1818 visitCilExpr visitor
1919
20+ let fieldinfo_is_anon (fi : fieldinfo ) =
21+ String. starts_with ~prefix: " __annonCompField" fi.fname (* TODO: what if CIL-ed program explicitly has this? *)
22+
23+ let rec offset_remove_anon_comp_offset = function
24+ | NoOffset -> NoOffset
25+ | Index (e , offs' ) -> Index (e, offset_remove_anon_comp_offset offs')
26+ | Field (fi , offs' ) ->
27+ let offs'' = offset_remove_anon_comp_offset offs' in
28+ if fieldinfo_is_anon fi then (
29+ match offs'' with
30+ | Field _ -> offs''
31+ | NoOffset
32+ | Index _ -> failwith " offset_remove_anon_comp_offset: anon comp field not followed by field"
33+ )
34+ else
35+ Field (fi, offs'')
36+
37+ class exp_remove_anon_comp_offset_visitor = object
38+ inherit nopCilVisitor
39+ method! voffs (offs: offset ) =
40+ ChangeTo (offset_remove_anon_comp_offset offs)
41+ end
42+ let exp_remove_anon_comp_offset =
43+ let visitor = new exp_remove_anon_comp_offset_visitor in
44+ visitCilExpr visitor
45+
2046class exp_deep_unroll_types_visitor = object
2147 inherit nopCilVisitor
2248 method! vtype (t: typ ) =
You can’t perform that action at this time.
0 commit comments