File tree Expand file tree Collapse file tree 3 files changed +26
-1
lines changed 
regression/cbmc/Struct_Hack_Initialization Expand file tree Collapse file tree 3 files changed +26
-1
lines changed Original file line number Diff line number Diff line change 1+ #include  <assert.h> 
2+ 
3+ typedef  struct  stritem 
4+ {
5+   unsigned  nkey ;
6+   unsigned  cas [];
7+ } item ;
8+ 
9+ int  foo (item  * it )
10+ {
11+   assert (it -> cas [0 ] ==  0 );
12+   return  0 ;
13+ }
Original file line number Diff line number Diff line change 1+ CORE
2+ main.c
3+ --function foo --bounds-check --pointer-check
4+ ^\[foo.assertion.1\] line \d+ assertion it->cas\[0\] == 0: FAILURE$
5+ ^\[foo.array_bounds.3\] line \d+ array.cas upper bound in it->cas\[\(.*\)0\]: FAILURE$
6+ ^\[foo.array_bounds.2\] line \d+ array.cas dynamic object upper bound in it->cas\[\(.*\)0\]: FAILURE$
7+ ^\[foo.pointer_dereference.2\] line \d+ dereference failure: pointer invalid in it->cas: SUCCESS$
8+ ^\[foo.pointer_dereference.6\] line \d+ dereference failure: pointer outside object bounds in it->cas: FAILURE$
9+ ^EXIT=10$
10+ ^SIGNAL=0$
11+ ^VERIFICATION FAILED$
12+ --
13+ ^warning: ignoring
Original file line number Diff line number Diff line change @@ -163,7 +163,6 @@ void symbol_factoryt::gen_nondet_array_init(
163163  const  auto  &size = array_type.size ();
164164  PRECONDITION (size.id () == ID_constant);
165165  auto  const  array_size = numeric_cast_v<size_t >(to_constant_expr (size));
166-   DATA_INVARIANT (array_size > 0 , " Arrays should have positive size"  );
167166  for (size_t  index = 0 ; index < array_size; ++index)
168167  {
169168    gen_nondet_init (
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments