File tree 1 file changed +7
-3
lines changed
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
775
775
}
776
776
};
777
777
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
779
780
class binary_relation_exprt :public binary_predicate_exprt
780
781
{
781
782
public:
@@ -811,10 +812,13 @@ class binary_relation_exprt:public binary_predicate_exprt
811
812
{
812
813
binary_predicate_exprt::validate (expr, ns, vm);
813
814
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
815
819
DATA_CHECK (
816
820
vm,
817
- expr .op0 ().type () == expr .op1 ().type (),
821
+ expr_binary .op0 ().type () == expr_binary .op1 ().type (),
818
822
" lhs and rhs of binary relation expression should have same type" );
819
823
}
820
824
You can’t perform that action at this time.
0 commit comments