mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-14 22:34:09 +02:00
Fixed error when const range checking against null
This commit is contained in:
parent
7e55369f92
commit
85d197f552
2 changed files with 7 additions and 0 deletions
|
@ -493,6 +493,11 @@ namespace System
|
||||||
mTarget = target;
|
mTarget = target;
|
||||||
mFuncPtr = ptr;
|
mFuncPtr = ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void GCMarkMembers()
|
||||||
|
{
|
||||||
|
GC.Mark(Internal.UnsafeCastToObject(mTarget));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct DeferredCall
|
struct DeferredCall
|
||||||
|
|
|
@ -16241,6 +16241,8 @@ bool BfExprEvaluator::CheckConstCompare(BfBinaryOp binaryOp, BfAstNode* opToken,
|
||||||
|
|
||||||
BF_ASSERT(rightValue.mValue.IsConst());
|
BF_ASSERT(rightValue.mValue.IsConst());
|
||||||
auto rightConst = mModule->mBfIRBuilder->GetConstant(rightValue.mValue);
|
auto rightConst = mModule->mBfIRBuilder->GetConstant(rightValue.mValue);
|
||||||
|
if (!mModule->mBfIRBuilder->IsInt(rightConst->mTypeCode))
|
||||||
|
return false;
|
||||||
|
|
||||||
BfType* checkType = leftValue.mType;
|
BfType* checkType = leftValue.mType;
|
||||||
if (checkType->IsTypedPrimitive())
|
if (checkType->IsTypedPrimitive())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue