1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 19:48:20 +02:00

Fixed ObjectAccessCheck with null constant

This commit is contained in:
Brian Fiete 2020-11-18 10:03:10 -08:00
parent d4ea9bce2b
commit 3e763b41df

View file

@ -9127,6 +9127,13 @@ void BfModule::EmitObjectAccessCheck(BfTypedValue typedVal)
if (!mCompiler->mOptions.mObjectHasDebugFlags)
return;
if (typedVal.mValue.IsConst())
{
auto constant = mBfIRBuilder->GetConstant(typedVal.mValue);
if (constant->mTypeCode == BfTypeCode_NullPtr)
return;
}
bool emitObjectAccessCheck = mCompiler->mOptions.mEmitObjectAccessCheck;
auto typeOptions = GetTypeOptions();
if (typeOptions != NULL)