File tree 6 files changed +50
-14
lines changed
cbmc-concurrency/thread_local2
6 files changed +50
-14
lines changed Original file line number Diff line number Diff line change
1
+ int __CPROVER_thread_local thlocal = 4 ;
2
+
3
+ int main ()
4
+ {
5
+ int loc ;
6
+
7
+ loc = 123 ;
8
+
9
+ __CPROVER_ASYNC_3 :
10
+ thlocal = loc , __CPROVER_assert (thlocal == 123 , "hello" );
11
+ }
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
1
+ #include <assert.h>
2
+
3
+ extern int x ;
4
+
5
+ int main (int argc , char * argv [])
6
+ {
7
+ if (argc > 5 )
8
+ x = 42 ;
9
+
10
+ __CPROVER_assert (x == 42 , "should fail" );
11
+ }
Original file line number Diff line number Diff line change
1
+ CORE
2
+ main.c
3
+
4
+ ^EXIT=10$
5
+ ^SIGNAL=0$
6
+ ^VERIFICATION FAILED$
7
+ --
8
+ --
9
+ The change to phi_function of 646cf29941499 failed to consider the case of
10
+ extern variables, which we leave uninitialised.
Original file line number Diff line number Diff line change @@ -218,17 +218,6 @@ void goto_symext::symex_assign_symbol(
218
218
guardt &guard,
219
219
assignment_typet assignment_type)
220
220
{
221
- // do not assign to L1 objects that have gone out of scope --
222
- // pointer dereferencing may yield such objects; parameters do not
223
- // have an L2 entry set up beforehand either, so exempt them from
224
- // this check (all other L1 objects should have seen a declaration)
225
- const symbolt *s;
226
- if (!ns.lookup (lhs.get_object_name (), s) &&
227
- !s->is_parameter &&
228
- !lhs.get_level_1 ().empty () &&
229
- state.level2 .current_count (lhs.get_identifier ())==0 )
230
- return ;
231
-
232
221
exprt ssa_rhs=rhs;
233
222
234
223
// put assignment guard into the rhs
Original file line number Diff line number Diff line change @@ -423,7 +423,14 @@ static void merge_names(
423
423
if (goto_count == dest_count)
424
424
return ; // not at all changed
425
425
426
- // changed!
426
+ // changed - but only on a branch that is now dead, and the other branch is
427
+ // uninitialized/invalid
428
+ if (
429
+ (dest_state.guard .is_false () && goto_count == 0 ) ||
430
+ (goto_state.guard .is_false () && dest_count == 0 ))
431
+ {
432
+ return ;
433
+ }
427
434
428
435
// shared variables are renamed on every access anyway, we don't need to
429
436
// merge anything
@@ -473,11 +480,11 @@ static void merge_names(
473
480
rhs = goto_state_rhs;
474
481
else if (goto_state.guard .is_false ())
475
482
rhs = dest_state_rhs;
476
- else if (goto_count == 0 )
483
+ else if (goto_count == 0 && symbol. value . is_not_nil () )
477
484
{
478
485
rhs = dest_state_rhs;
479
486
}
480
- else if (dest_count == 0 )
487
+ else if (dest_count == 0 && symbol. value . is_not_nil () )
481
488
{
482
489
rhs = goto_state_rhs;
483
490
}
You can’t perform that action at this time.
0 commit comments