File tree Expand file tree Collapse file tree 5 files changed +44
-0
lines changed Expand file tree Collapse file tree 5 files changed +44
-0
lines changed Original file line number Diff line number Diff line change
1
+ union U {
2
+ int x ;
3
+ char c [sizeof (int )];
4
+ };
5
+
6
+ int main ()
7
+ {
8
+ union U u ;
9
+ // make the lowest and highest byte 1
10
+ u .x = 1 | (1 << (sizeof (int ) * 8 - 8 ));
11
+ int i = u .x ;
12
+ char c0 = u .c [0 ];
13
+ char c1 = u .c [1 ];
14
+ char c2 = u .c [2 ];
15
+ char c3 = u .c [3 ];
16
+
17
+ __CPROVER_assert (u .c [0 ] == 1 , "" );
18
+
19
+ return 0 ;
20
+ }
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 @@ -860,6 +860,7 @@ void interpretert::execute_function_call()
860
860
void interpretert::build_memory_map ()
861
861
{
862
862
// put in a dummy for NULL
863
+ memory.clear ();
863
864
memory.resize (1 );
864
865
inverse_memory_map[0 ] = {};
865
866
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