File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -775,7 +775,8 @@ class binary_predicate_exprt:public binary_exprt
775775 }
776776};
777777
778- // / \brief A base class for relations, i.e., binary predicates
778+ // / \brief A base class for relations, i.e., binary predicates whose
779+ // / two operands have the same type
779780class binary_relation_exprt :public binary_predicate_exprt
780781{
781782public:
@@ -811,10 +812,13 @@ class binary_relation_exprt:public binary_predicate_exprt
811812 {
812813 binary_predicate_exprt::validate (expr, ns, vm);
813814
814- // check types
815+ // we now can safely assume that 'expr' is a binary predicate
816+ const auto &expr_binary = static_cast <const binary_predicate_exprt &>(expr);
817+
818+ // check that the types of the operands are the same
815819 DATA_CHECK (
816820 vm,
817- expr .op0 ().type () == expr .op1 ().type (),
821+ expr_binary .op0 ().type () == expr_binary .op1 ().type (),
818822 " lhs and rhs of binary relation expression should have same type" );
819823 }
820824
You can’t perform that action at this time.
0 commit comments