Skip to content

Commit 9b31039

Browse files
authored
Merge pull request #4191 from tautschnig/byte-extract-pointers
byte_extract lowering of pointers [blocks: #2068]
2 parents 7632d02 + 004bd27 commit 9b31039

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/solvers/lowering/byte_operators.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,17 @@ static exprt unpack_rec(
264264
member, little_endian, offset_bytes, max_bytes, ns, true);
265265
}
266266
}
267+
else if(src.type().id() == ID_pointer)
268+
{
269+
return unpack_rec(
270+
typecast_exprt(
271+
src, unsignedbv_typet(to_pointer_type(src.type()).get_width())),
272+
little_endian,
273+
offset_bytes,
274+
max_bytes,
275+
ns,
276+
unpack_byte_array);
277+
}
267278
else if(src.type().id()!=ID_empty)
268279
{
269280
// a basic type; we turn that into extractbits while considering

unit/solvers/lowering/byte_operators.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ SCENARIO("byte_extract_lowering", "[core][solvers][lowering][byte_extract]")
124124
signedbv_typet(24),
125125
signedbv_typet(128),
126126
// ieee_float_spect::single_precision().to_type(),
127+
// generates the correct value, but remains wrapped in a typecast
127128
// pointer_typet(u64, 64),
128129
vector_typet(u8, size),
129130
vector_typet(u64, size),

0 commit comments

Comments
 (0)