Skip to content

byte_extract lowering of pointers [blocks: #2068] #4191

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/solvers/lowering/byte_operators.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,17 @@ static exprt unpack_rec(
member, little_endian, offset_bytes, max_bytes, ns, true);
}
}
else if(src.type().id() == ID_pointer)
{
return unpack_rec(
typecast_exprt(
src, unsignedbv_typet(to_pointer_type(src.type()).get_width())),
little_endian,
offset_bytes,
max_bytes,
ns,
unpack_byte_array);
}
else if(src.type().id()!=ID_empty)
{
// a basic type; we turn that into extractbits while considering
Expand Down
1 change: 1 addition & 0 deletions unit/solvers/lowering/byte_operators.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ SCENARIO("byte_extract_lowering", "[core][solvers][lowering][byte_extract]")
signedbv_typet(24),
signedbv_typet(128),
// ieee_float_spect::single_precision().to_type(),
// generates the correct value, but remains wrapped in a typecast
// pointer_typet(u64, 64),
vector_typet(u8, size),
vector_typet(u64, size),
Expand Down