File tree 6 files changed +63
-0
lines changed
regression/goto-instrument
6 files changed +63
-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$
Original file line number Diff line number Diff line change @@ -337,6 +337,10 @@ static bool implicit(goto_programt::const_targett target)
337
337
{
338
338
// some variables are used during symbolic execution only
339
339
340
+ const irep_idt &statement=target->code .get_statement ();
341
+ if (statement==ID_array_copy)
342
+ return true ;
343
+
340
344
if (!target->is_assign ())
341
345
return false ;
342
346
Original file line number Diff line number Diff line change @@ -1729,6 +1729,9 @@ void value_set_fit::apply_code(
1729
1729
else if (statement==ID_fence)
1730
1730
{
1731
1731
}
1732
+ else if (statement==ID_array_copy)
1733
+ {
1734
+ }
1732
1735
else if (statement==ID_input || statement==ID_output)
1733
1736
{
1734
1737
// doesn't do anything
You can’t perform that action at this time.
0 commit comments