1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-07-04 15:26:00 +02:00

Fixed error when const range checking against null

This commit is contained in:
Brian Fiete 2019-10-05 11:27:59 -07:00
parent 7e55369f92
commit 85d197f552
2 changed files with 7 additions and 0 deletions

View file

@ -16241,6 +16241,8 @@ bool BfExprEvaluator::CheckConstCompare(BfBinaryOp binaryOp, BfAstNode* opToken,
BF_ASSERT(rightValue.mValue.IsConst());
auto rightConst = mModule->mBfIRBuilder->GetConstant(rightValue.mValue);
if (!mModule->mBfIRBuilder->IsInt(rightConst->mTypeCode))
return false;
BfType* checkType = leftValue.mType;
if (checkType->IsTypedPrimitive())