File tree 2 files changed +18
-3
lines changed 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change 11
11
#include < cassert>
12
12
13
13
#include < util/arith_tools.h>
14
+ #include < util/expr_util.h>
14
15
#include < util/std_expr.h>
15
16
#include < util/byte_operators.h>
16
17
@@ -39,8 +40,11 @@ bvt boolbvt::convert_byte_extract(const byte_extract_exprt &expr)
39
40
if (expr.operands ().size ()!=2 )
40
41
throw " byte_extract takes two operands" ;
41
42
42
- // if we extract from an unbounded array, call the flattening code
43
- if (is_unbounded_array (expr.op ().type ()))
43
+ // if we extract from an unbounded array or a data type that
44
+ // includes pointers, call the flattening code
45
+ if (is_unbounded_array (expr.op ().type ()) ||
46
+ has_subtype (expr.type (), ID_pointer, ns) ||
47
+ has_subtype (expr.op ().type (), ID_pointer, ns))
44
48
{
45
49
exprt tmp=flatten_byte_extract (expr, ns);
46
50
return convert_bv (tmp);
Original file line number Diff line number Diff line change 8
8
9
9
#include " boolbv.h"
10
10
11
- #include < iostream>
12
11
#include < cassert>
13
12
14
13
#include < util/arith_tools.h>
15
14
#include < util/byte_operators.h>
15
+ #include < util/expr_util.h>
16
16
17
17
#include " bv_endianness_map.h"
18
+ #include " flatten_byte_operators.h"
18
19
19
20
bvt boolbvt::convert_byte_update (const byte_update_exprt &expr)
20
21
{
21
22
if (expr.operands ().size ()!=3 )
22
23
throw " byte_update takes three operands" ;
23
24
25
+ // if we update an unbounded array or a data type that
26
+ // includes pointers, call the flattening code
27
+ if (is_unbounded_array (expr.op ().type ()) ||
28
+ has_subtype (expr.value ().type (), ID_pointer, ns) ||
29
+ has_subtype (expr.op0 ().type (), ID_pointer, ns))
30
+ {
31
+ exprt tmp=flatten_byte_update (expr, ns);
32
+ return convert_bv (tmp);
33
+ }
34
+
24
35
const exprt &op=expr.op0 ();
25
36
const exprt &offset_expr=expr.offset ();
26
37
const exprt &value=expr.value ();
You can’t perform that action at this time.
0 commit comments