File tree Expand file tree Collapse file tree 2 files changed +37
-0
lines changed
regression/cbmc-shadow-memory/no-shadow-memory-matching1 Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Original file line number Diff line number Diff line change
1
+ #include <assert.h>
2
+ #include <stdlib.h>
3
+
4
+ struct STRUCTNAME
5
+ {
6
+ int x ;
7
+ };
8
+
9
+ void f_charptr_val (char * __cs_param )
10
+ {
11
+ // Access to shadow memory of z.
12
+ assert (__CPROVER_get_field (__cs_param , "field1" ) == 255 );
13
+
14
+ // Fails because parameter itself doesn't have shadow memory.
15
+ assert (__CPROVER_get_field (& __cs_param , "field1" ) == 0 );
16
+ }
17
+
18
+ int main ()
19
+ {
20
+ __CPROVER_field_decl_local ("field1" , (char )0 );
21
+
22
+ char * __cs_threadargs [2 ];
23
+ struct STRUCTNAME z ;
24
+ __CPROVER_set_field (& z , "field1" , 255 );
25
+
26
+ __cs_threadargs [1 ] = (char * )(& z );
27
+ f_charptr_val (__cs_threadargs [1 ]);
28
+ }
Original file line number Diff line number Diff line change
1
+ FUTURE
2
+ main.c
3
+ --no-shadow-memory-matching '.*\.c:.*__cs_.*'
4
+ ^EXIT=0$
5
+ ^SIGNAL=0$
6
+ ^VERIFICATION SUCCESSFUL$
7
+ --
8
+ ^warning: ignoring
9
+ ^Shadow memory: field 'field1' expected to exist for
You can’t perform that action at this time.
0 commit comments