mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 04:22:20 +02:00
Fixed ObjectAccessCheck with null constant
This commit is contained in:
parent
d4ea9bce2b
commit
3e763b41df
1 changed files with 7 additions and 0 deletions
|
@ -9127,6 +9127,13 @@ void BfModule::EmitObjectAccessCheck(BfTypedValue typedVal)
|
||||||
if (!mCompiler->mOptions.mObjectHasDebugFlags)
|
if (!mCompiler->mOptions.mObjectHasDebugFlags)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (typedVal.mValue.IsConst())
|
||||||
|
{
|
||||||
|
auto constant = mBfIRBuilder->GetConstant(typedVal.mValue);
|
||||||
|
if (constant->mTypeCode == BfTypeCode_NullPtr)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
bool emitObjectAccessCheck = mCompiler->mOptions.mEmitObjectAccessCheck;
|
bool emitObjectAccessCheck = mCompiler->mOptions.mEmitObjectAccessCheck;
|
||||||
auto typeOptions = GetTypeOptions();
|
auto typeOptions = GetTypeOptions();
|
||||||
if (typeOptions != NULL)
|
if (typeOptions != NULL)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue