From 705c739750746f7f8839bc31665f65e86a84746a Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Sun, 30 Aug 2020 10:06:17 -0700 Subject: [PATCH] Fixed ternary operator with literals without expected type --- IDEHelper/Compiler/BfExprEvaluator.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/IDEHelper/Compiler/BfExprEvaluator.cpp b/IDEHelper/Compiler/BfExprEvaluator.cpp index 8f4605cb..b051caf5 100644 --- a/IDEHelper/Compiler/BfExprEvaluator.cpp +++ b/IDEHelper/Compiler/BfExprEvaluator.cpp @@ -15703,6 +15703,7 @@ void BfExprEvaluator::Visit(BfConditionalExpression* condExpr) auto checkTrueValue = mModule->Cast(condExpr->mTrueExpression, trueValue, mExpectingType, BfCastFlags_SilentFail); if (checkTrueValue) trueValue = checkTrueValue; + mModule->FixIntUnknown(trueValue); } auto trueBlockPos = mModule->mBfIRBuilder->GetInsertBlock(); @@ -15714,6 +15715,7 @@ void BfExprEvaluator::Visit(BfConditionalExpression* condExpr) auto checkFalseValue = mModule->Cast(condExpr->mFalseExpression, falseValue, mExpectingType, BfCastFlags_SilentFail); if (checkFalseValue) falseValue = checkFalseValue; + mModule->FixIntUnknown(falseValue); } bool isValid = trueValue && falseValue;