File tree Expand file tree Collapse file tree 2 files changed +32
-7
lines changed
tests/regression/03-practical Expand file tree Collapse file tree 2 files changed +32
-7
lines changed Original file line number Diff line number Diff line change @@ -112,14 +112,18 @@ struct
112112 r
113113 )
114114 | Mem (Lval lv ), off ->
115- let lvals = eval_lv ~man st (Mem (Lval lv), off) in
116- let res = AD. fold (fun a acc ->
115+ (* Underlying lvals (may have offsets themselves), e.g., for struct members NOT including any offset appended to outer Mem *)
116+ let lvals = eval_lv ~man st (Mem (Lval lv), NoOffset ) in
117+ (* Additional offset of value being refined in Addr Offset type *)
118+ let original_offset = convert_offset ~man st off in
119+ let res = AD. fold (fun base_a acc ->
117120 Option. bind acc (fun acc ->
118- match a with
119- | Addr (base , _ ) as orig ->
120- let (a:VD.t ) = Address (AD. singleton (AD.Addr. of_var base)) in
121- if M. tracing then M. tracel " inv" " Consider case of lval %a = %a" d_lval lv VD. pretty a;
122- let st = set' lv a st in
121+ match base_a with
122+ | Addr _ ->
123+ let (lval_a:VD.t ) = Address (AD. singleton base_a) in
124+ if M. tracing then M. tracel " inv" " Consider case of lval %a = %a" d_lval lv VD. pretty lval_a;
125+ let st = set' lv lval_a st in
126+ let orig = AD.Addr. add_offset base_a original_offset in
123127 let old_val = get ~man st (AD. singleton orig) None in
124128 let old_val = VD. cast (Cilfacade. typeOfLval x) old_val in (* needed as the type of this pointer may be different *)
125129 (* this what I would originally have liked to do, but eval_rv_lval_refine uses queries and thus stale values *)
Original file line number Diff line number Diff line change 1+ #include <goblint.h>
2+ struct aws_al {
3+ unsigned long current_size ;
4+ };
5+
6+ struct aws_pq {
7+ int pred ;
8+ struct aws_al container ;
9+ };
10+
11+ int main () {
12+ struct aws_pq queue = { 0 , { 0 }};
13+ struct aws_al * const list = & queue .container ;
14+
15+ if (list -> current_size == 0UL ) {
16+ if (list -> current_size == 0UL )
17+ {
18+ __goblint_check (1 ); //REACHABLE
19+ }
20+ }
21+ }
You can’t perform that action at this time.
0 commit comments