File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed
tests/regression/74-invalid_deref Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -174,7 +174,7 @@ struct
174174 `Index (ID. top () , convert_offset ofs)
175175 | Index (exp , ofs ) ->
176176 let i = match man.ask (Queries. EvalInt exp) with
177- | `Lifted x -> x
177+ | `Lifted x -> ID. cast_to ( Cilfacade. ptrdiff_ikind () ) x
178178 | _ -> ID. top_of @@ Cilfacade. ptrdiff_ikind ()
179179 in
180180 `Index (i, convert_offset ofs)
Original file line number Diff line number Diff line change 1+ //PARAM: --set ana.activated[+] memOutOfBounds
2+ //NOCRASH (had invalid ikind exceptions earlier)
3+ #include <stdlib.h>
4+
5+ typedef enum {
6+ ITEM_PREV ,
7+ ITEM_NEXT
8+ } direction_t ;
9+
10+ struct s {
11+ int head [2 ];
12+ };
13+
14+
15+ int main ()
16+ {
17+ struct s * item = malloc (sizeof (struct s ));
18+ direction_t link_field = ITEM_NEXT ;
19+ item -> head [link_field ] = 0 ;
20+ return 0 ;
21+ }
You can’t perform that action at this time.
0 commit comments