Skip to content

Add separate overflow expr classes #6744

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
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
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
4 changes: 4 additions & 0 deletions src/util/bitvector_expr.h
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,10 @@ class binary_overflow_exprt : public binary_predicate_exprt
binary_overflow_exprt(exprt _lhs, const irep_idt &kind, exprt _rhs)
: binary_predicate_exprt(std::move(_lhs), make_id(kind), std::move(_rhs))
{
INVARIANT(
Copy link
Contributor

Choose a reason for hiding this comment

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

I quite like this.

I favour things being correct by construction, and subsequently, for the invariants to be set as early as possible.

valid_id(id()),
"The kind used to construct binary_overflow_exprt should be in the set "
"of expected valid kinds.");
}

static void check(
Expand Down