File tree Expand file tree Collapse file tree 4 files changed +56
-0
lines changed
regression/goto-instrument Expand file tree Collapse file tree 4 files changed +56
-0
lines changed Original file line number Diff line number Diff line change 1+ #include <stdlib.h>
2+ #include <assert.h>
3+
4+ int main ()
5+ {
6+ int * ptr = malloc (sizeof (int ));
7+ * ptr = 42 ;
8+ ptr = realloc (ptr , 20 );
9+ assert (* ptr == 42 );
10+
11+ int * ptr2 = malloc (2 * sizeof (int ));
12+ * ptr2 = 42 ;
13+ * (ptr2 + 1 )= 42 ;
14+ ptr2 = realloc (ptr2 , 20 );
15+ assert (* ptr2 == 42 );
16+ assert (* (ptr2 + 1 )== 42 );
17+
18+ return 0 ;
19+ }
Original file line number Diff line number Diff line change 1+ CORE
2+ main.c
3+ --full-slice --add-library
4+ ^EXIT=0$
5+ ^SIGNAL=0$
6+ ^VERIFICATION SUCCESSFUL$
Original file line number Diff line number Diff line change 1+ #include <stdlib.h>
2+ #include <assert.h>
3+
4+ void foo (int argc )
5+ {
6+ void * x = 0 ;
7+
8+ if (argc > 3 )
9+ x = malloc (4 * sizeof (int ));
10+ else
11+ x = malloc (3 * sizeof (int ));
12+ * (int * )x = 42 ;
13+
14+ x = realloc (x , sizeof (int ));
15+
16+ assert (* (int * )x == 42 );
17+ }
18+
19+ int main (int argc , char * argv [])
20+ {
21+ //__CPROVER_ASYNC_1:
22+ foo (argc );
23+
24+ return 0 ;
25+ }
Original file line number Diff line number Diff line change 1+ CORE
2+ main.c
3+ --full-slice --add-library
4+ ^EXIT=0$
5+ ^SIGNAL=0$
6+ ^VERIFICATION SUCCESSFUL$
You can’t perform that action at this time.
0 commit comments