File tree 2 files changed +46
-0
lines changed
2 files changed +46
-0
lines changed Original file line number Diff line number Diff line change
1
+ #include <assert.h>
2
+
3
+ int main (int argc , char * argv [])
4
+ {
5
+ unsigned char x = argc ;
6
+ // make sure int multiplication below won't overflow - type casting to
7
+ // unsigned long long would be possible, but puts yields a challenging problem
8
+ // for the SAT solver
9
+ __CPROVER_assume (x < 1ULL << (sizeof (int ) * 8 / 2 - 1 ));
10
+
11
+ struct S
12
+ {
13
+ int a ;
14
+ int b [x ];
15
+ int c ;
16
+ };
17
+
18
+ if (x % 2 == 0 )
19
+ x = 3 ;
20
+
21
+ struct S s [x ];
22
+
23
+ if ((unsigned char )argc > 0 )
24
+ {
25
+ s [0 ].b [0 ] = 42 ;
26
+ assert (s [0 ].b [0 ] == 42 );
27
+ }
28
+
29
+ __CPROVER_assume (x < 255 );
30
+ ++ x ;
31
+
32
+ assert (sizeof (struct S ) == ((unsigned char )argc + 2 ) * sizeof (int ));
33
+ assert (sizeof (s ) == (x - 1 ) * ((unsigned char )argc + 2 ) * sizeof (int ));
34
+
35
+ return 0 ;
36
+ }
Original file line number Diff line number Diff line change
1
+ KNOWNBUG
2
+ main.c
3
+
4
+ ^EXIT=0$
5
+ ^SIGNAL=0$
6
+ ^VERIFICATION SUCCESSFUL$
7
+ --
8
+ ^warning: ignoring
9
+ --
10
+ The array decision procedure does not yet handle member expressions.
You can’t perform that action at this time.
0 commit comments