From 7013b9ea548b590214f1822a2a55a7b532726e2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20L=C3=BChne?= Date: Thu, 3 May 2018 16:52:29 +0200 Subject: [PATCH] Fix equality check for binary operations Multiplication and addition are commutative binary operations, where the equality between the operands has to be also checked in switched order. By mistake, the operands were not compared with the other binary operation, which is fixed by this commit. --- include/anthem/Equality.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/anthem/Equality.h b/include/anthem/Equality.h index 64d16e5..b629299 100644 --- a/include/anthem/Equality.h +++ b/include/anthem/Equality.h @@ -268,8 +268,8 @@ struct TermEqualityVisitor return Tristate::Unknown; } - if (equal(binaryOperation.left, binaryOperation.right) == Tristate::True - && equal(binaryOperation.right, binaryOperation.left) == Tristate::True) + if (equal(binaryOperation.left, otherBinaryOperation.right) == Tristate::True + && equal(binaryOperation.right, otherBinaryOperation.left) == Tristate::True) { return Tristate::True; }