Skip to content

byte_extract lowering: lower newly introduced byte_extract expressions [depends-on: #4061, blocks: #2068] #4062

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 7, 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
2 changes: 1 addition & 1 deletion src/solvers/lowering/byte_operators.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ exprt lower_byte_extract(const byte_extract_exprt &src, const namespacet &ns)
tmp.type()=comp.type();
tmp.offset()=new_offset;

s.add_to_operands(std::move(tmp));
s.add_to_operands(lower_byte_extract(tmp, ns));
}

if(!failed)
Expand Down
5 changes: 2 additions & 3 deletions unit/solvers/lowering/byte_operators.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,8 @@ SCENARIO("byte_extract_lowering", "[core][solvers][lowering][byte_extract]")
const exprt lower_be = lower_byte_extract(be, ns);
const exprt lower_be_s = simplify_expr(lower_be, ns);

// TODO: does not currently hold
// REQUIRE(!has_subexpr(lower_be, ID_byte_extract_little_endian));
// REQUIRE(!has_subexpr(lower_be, ID_byte_extract_big_endian));
REQUIRE(!has_subexpr(lower_be, ID_byte_extract_little_endian));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Presumably also big_endian?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, indeed, actually that should be fixed in the first commit (which is #4061).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

REQUIRE(!has_subexpr(lower_be, ID_byte_extract_big_endian));
REQUIRE(lower_be.type() == be.type());
// TODO: does not currently hold
// REQUIRE(lower_be == r);
Expand Down