mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-14 14:24:10 +02:00
Fixed ternary operator with literals without expected type
This commit is contained in:
parent
16e6097dad
commit
705c739750
1 changed files with 2 additions and 0 deletions
|
@ -15703,6 +15703,7 @@ void BfExprEvaluator::Visit(BfConditionalExpression* condExpr)
|
||||||
auto checkTrueValue = mModule->Cast(condExpr->mTrueExpression, trueValue, mExpectingType, BfCastFlags_SilentFail);
|
auto checkTrueValue = mModule->Cast(condExpr->mTrueExpression, trueValue, mExpectingType, BfCastFlags_SilentFail);
|
||||||
if (checkTrueValue)
|
if (checkTrueValue)
|
||||||
trueValue = checkTrueValue;
|
trueValue = checkTrueValue;
|
||||||
|
mModule->FixIntUnknown(trueValue);
|
||||||
}
|
}
|
||||||
auto trueBlockPos = mModule->mBfIRBuilder->GetInsertBlock();
|
auto trueBlockPos = mModule->mBfIRBuilder->GetInsertBlock();
|
||||||
|
|
||||||
|
@ -15714,6 +15715,7 @@ void BfExprEvaluator::Visit(BfConditionalExpression* condExpr)
|
||||||
auto checkFalseValue = mModule->Cast(condExpr->mFalseExpression, falseValue, mExpectingType, BfCastFlags_SilentFail);
|
auto checkFalseValue = mModule->Cast(condExpr->mFalseExpression, falseValue, mExpectingType, BfCastFlags_SilentFail);
|
||||||
if (checkFalseValue)
|
if (checkFalseValue)
|
||||||
falseValue = checkFalseValue;
|
falseValue = checkFalseValue;
|
||||||
|
mModule->FixIntUnknown(falseValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isValid = trueValue && falseValue;
|
bool isValid = trueValue && falseValue;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue