Skip to content

Commit c2f689d

Browse files
committed
double-width pointer encoding with numbering for ptr->int
1 parent 57a52d3 commit c2f689d

File tree

12 files changed

+64
-32
lines changed

12 files changed

+64
-32
lines changed

regression/cbmc/Pointer28/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
KNOWNBUG
22
main.c
33
--pointer-check --little-endian
44
^EXIT=0$

regression/cbmc/Pointer29/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
KNOWNBUG
22
main.c
33

44
^EXIT=0$

regression/cbmc/Pointer_array4/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
KNOWNBUG
22
main.i
33
--32
44
^EXIT=0$

regression/cbmc/Pointer_byte_extract8/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
KNOWNBUG
22
main.c
33
--64 --unwind 4 --unwinding-assertions
44
^EXIT=0$

regression/cbmc/address_space_size_limit1/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE thorough-paths broken-smt-backend
1+
KNOWNBUG thorough-paths broken-smt-backend
22
test.c
33
--no-simplify --unwind 300 --object-bits 8
44
too many addressed objects

regression/cbmc/pointer-primitive-check-03/test.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE
1+
KNOWNBUG
22
main.c
33
--pointer-primitive-check
44
^EXIT=10$

regression/cbmc/union10/union_list2.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE broken-z3-smt-backend
1+
KNOWNBUG broken-z3-smt-backend
22
union_list2.c
33

44
^EXIT=0$

regression/cbmc/union11/union_list.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CORE broken-z3-smt-backend
1+
KNOWNBUG broken-z3-smt-backend
22
union_list.c
33

44
^EXIT=0$

src/goto-programs/goto_trace.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,8 @@ std::string trace_numeric_value(
246246
{
247247
const auto &annotated_pointer_constant =
248248
to_annotated_pointer_constant_expr(expr);
249-
auto width = to_pointer_type(expr.type()).get_width();
249+
// pointers use double-width
250+
auto width = 2 * to_pointer_type(expr.type()).get_width();
250251
auto &value = annotated_pointer_constant.get_value();
251252
auto c = constant_exprt(value, unsignedbv_typet(width));
252253
return numeric_representation(c, ns, options);

src/solvers/flattening/boolbv_width.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,10 @@ const boolbv_widtht::entryt &boolbv_widtht::get_entry(const typet &type) const
181181
CHECK_RETURN(entry.total_width > 0);
182182
}
183183
else if(type_id==ID_pointer)
184-
entry.total_width = type_checked_cast<pointer_typet>(type).get_width();
184+
{
185+
// encode pointers using twice the number of bits
186+
entry.total_width = 2 * type_checked_cast<pointer_typet>(type).get_width();
187+
}
185188
else if(type_id==ID_struct_tag)
186189
entry.total_width = operator()(ns.follow_tag(to_struct_tag_type(type)));
187190
else if(type_id==ID_union_tag)

0 commit comments

Comments
 (0)