From 5074b3e2ae7134d417bd129534c902c18acd1cd2 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Wed, 12 Aug 2020 07:41:16 -0700 Subject: [PATCH] Fixed commutability of comparison constraint --- IDEHelper/Compiler/BfExprEvaluator.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/IDEHelper/Compiler/BfExprEvaluator.cpp b/IDEHelper/Compiler/BfExprEvaluator.cpp index cbd6a711..9de36d34 100644 --- a/IDEHelper/Compiler/BfExprEvaluator.cpp +++ b/IDEHelper/Compiler/BfExprEvaluator.cpp @@ -18957,7 +18957,9 @@ void BfExprEvaluator::PerformBinaryOperation(BfAstNode* leftExpression, BfAstNod works = true; } } - else if ((oppositeBinaryOp != BfBinaryOp_None) && (opConstraint.mBinaryOp == oppositeBinaryOp)) + + if (((oppositeBinaryOp != BfBinaryOp_None) && (opConstraint.mBinaryOp == oppositeBinaryOp)) || + (opConstraint.mBinaryOp == BfBinaryOp_Compare)) { if ((mModule->CanCast(args[0].mTypedValue, opConstraint.mRightType)) && (mModule->CanCast(args[1].mTypedValue, opConstraint.mLeftType))) @@ -18965,7 +18967,8 @@ void BfExprEvaluator::PerformBinaryOperation(BfAstNode* leftExpression, BfAstNod works = true; } } - else if ((isComparison) && (opConstraint.mBinaryOp == BfBinaryOp_Compare)) + + if ((isComparison) && (opConstraint.mBinaryOp == BfBinaryOp_Compare)) { if ((mModule->CanCast(args[0].mTypedValue, opConstraint.mLeftType)) && (mModule->CanCast(args[1].mTypedValue, opConstraint.mRightType)))