-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide suitable diagnostics for equality-without-matching-types
- Loading branch information
1 parent
89cf6fe
commit 808dade
Showing
1 changed file
with
8 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,16 +12,20 @@ Author: Daniel Kroening, [email protected] | |
#include <util/base_type.h> | ||
#include <util/invariant.h> | ||
|
||
#include "bv_conversion_exceptions.h" | ||
#include "flatten_byte_operators.h" | ||
|
||
literalt boolbvt::convert_equality(const equal_exprt &expr) | ||
{ | ||
const bool is_base_type_eq = | ||
base_type_eq(expr.lhs().type(), expr.rhs().type(), ns); | ||
DATA_INVARIANT( | ||
is_base_type_eq, | ||
std::string("equality without matching types:\n") + "######### lhs: " + | ||
expr.lhs().pretty() + '\n' + "######### rhs: " + expr.rhs().pretty()); | ||
if(!is_base_type_eq) | ||
{ | ||
const std::string error_msg = | ||
std::string("equality without matching types:\n") + "######### lhs: " + | ||
expr.lhs().pretty() + '\n' + "######### rhs: " + expr.rhs().pretty(); | ||
throw bitvector_conversion_exceptiont(error_msg, expr); | ||
} | ||
|
||
// see if it is an unbounded array | ||
if(is_unbounded_array(expr.lhs().type())) | ||
|