File tree 4 files changed +33
-4
lines changed
regression/cbmc-concurrency/malloc2
4 files changed +33
-4
lines changed Original file line number Diff line number Diff line change
1
+ #include <stdlib.h>
2
+ #include <pthread.h>
3
+
4
+ _Bool set_done ;
5
+ int * ptr ;
6
+
7
+ void * set_x (void * arg )
8
+ {
9
+ * (int * )arg = 10 ;
10
+ set_done = 1 ;
11
+ }
12
+
13
+ int main (int argc , char * argv [])
14
+ {
15
+ __CPROVER_assume (argc >= sizeof (int ));
16
+ ptr = malloc (argc );
17
+ __CPROVER_ASYNC_1 : set_x (ptr );
18
+ __CPROVER_assume (set_done );
19
+ assert (* ptr == 10 );
20
+ return 0 ;
21
+ }
Original file line number Diff line number Diff line change
1
+ CORE
2
+ main.c
3
+
4
+ ^EXIT=0$
5
+ ^SIGNAL=0$
6
+ ^VERIFICATION SUCCESSFUL$
7
+ --
8
+ ^warning: ignoring
Original file line number Diff line number Diff line change @@ -581,10 +581,9 @@ void c_typecheck_baset::typecheck_array_type(array_typet &type)
581
581
new_symbol.base_name =id2string (current_symbol.base_name )+suffix;
582
582
new_symbol.type =size.type ();
583
583
new_symbol.type .set (ID_C_constant, true );
584
- new_symbol.is_type =false ;
585
- new_symbol.is_static_lifetime =false ;
586
584
new_symbol.value =size;
587
585
new_symbol.location =source_location;
586
+ new_symbol.mode = mode;
588
587
589
588
symbol_table.add (new_symbol);
590
589
Original file line number Diff line number Diff line change @@ -138,14 +138,15 @@ void goto_symext::symex_allocate(
138
138
{
139
139
exprt &size=to_array_type (object_type).size ();
140
140
141
- symbolt size_symbol;
141
+ auxiliary_symbolt size_symbol;
142
142
143
143
size_symbol.base_name =
144
144
" dynamic_object_size" +std::to_string (dynamic_counter);
145
145
size_symbol.name =" symex_dynamic::" +id2string (size_symbol.base_name );
146
- size_symbol.is_lvalue =true ;
147
146
size_symbol.type =tmp_size.type ();
148
147
size_symbol.mode = mode;
148
+ size_symbol.type .set (ID_C_constant, true );
149
+ size_symbol.value = size;
149
150
150
151
state.symbol_table .add (size_symbol);
151
152
You can’t perform that action at this time.
0 commit comments