File tree Expand file tree Collapse file tree 5 files changed +45
-0
lines changed Expand file tree Collapse file tree 5 files changed +45
-0
lines changed Original file line number Diff line number Diff line change
1
+ union U
2
+ {
3
+ int x ;
4
+ char c [sizeof (int )];
5
+ };
6
+
7
+ int main ()
8
+ {
9
+ union U u ;
10
+ // make the lowest and highest byte 1
11
+ u .x = 1 | (1 << (sizeof (int ) * 8 - 8 ));
12
+ int i = u .x ;
13
+ char c0 = u .c [0 ];
14
+ char c1 = u .c [1 ];
15
+ char c2 = u .c [2 ];
16
+ char c3 = u .c [3 ];
17
+
18
+ __CPROVER_assert (u .c [0 ] == 1 , "" );
19
+
20
+ return 0 ;
21
+ }
Original file line number Diff line number Diff line change
1
+ KNOWNBUG
2
+ main.c
3
+ se
4
+ ^Starting interpreter$
5
+ ^\d+- Program End\.$
6
+ ^EXIT=0$
7
+ ^SIGNAL=0$
8
+ --
9
+ ^assertion failed at \d+$
10
+ --
11
+ The memory model of the interpreter does not record individual bytes. Therefore,
12
+ an access to individual bytes still yields the full object, making the assertion
13
+ in this test spuriously fail.
Original file line number Diff line number Diff line change 41
41
#include < goto-programs/remove_unused_functions.h>
42
42
#include < goto-programs/remove_virtual_functions.h>
43
43
#include < goto-programs/restrict_function_pointers.h>
44
+ #include < goto-programs/rewrite_union.h>
44
45
#include < goto-programs/set_properties.h>
45
46
#include < goto-programs/show_properties.h>
46
47
#include < goto-programs/show_symbol_table.h>
@@ -599,6 +600,9 @@ int goto_instrument_parse_optionst::doit()
599
600
600
601
if (cmdline.isset (" interpreter" ))
601
602
{
603
+ do_indirect_call_and_rtti_removal ();
604
+ rewrite_union (goto_model);
605
+
602
606
log.status () << " Starting interpreter" << messaget::eom;
603
607
interpreter (goto_model, ui_message_handler);
604
608
return CPROVER_EXIT_SUCCESS;
Original file line number Diff line number Diff line change @@ -861,6 +861,7 @@ void interpretert::execute_function_call()
861
861
void interpretert::build_memory_map ()
862
862
{
863
863
// put in a dummy for NULL
864
+ memory.clear ();
864
865
memory.resize (1 );
865
866
inverse_memory_map[0 ] = {};
866
867
Original file line number Diff line number Diff line change @@ -51,6 +51,12 @@ template<class T> class sparse_vectort
51
51
_size=new_size;
52
52
}
53
53
54
+ void clear ()
55
+ {
56
+ underlying.clear ();
57
+ _size = 0 ;
58
+ }
59
+
54
60
typedef typename underlyingt::iterator iteratort;
55
61
typedef typename underlyingt::const_iterator const_iteratort;
56
62
You can’t perform that action at this time.
0 commit comments