1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 04:22:20 +02:00

Made 'faked' static reference undef so it's not detected as constant

This commit is contained in:
Brian Fiete 2025-03-13 06:52:37 -04:00
parent cbfc091fce
commit 11ccb876a3
2 changed files with 3 additions and 1 deletions

View file

@ -664,6 +664,8 @@ bool BfIRConstHolder::IsConstValue(BfIRValue value)
if (constant->mConstType == BfConstType_GlobalVar) if (constant->mConstType == BfConstType_GlobalVar)
return false; return false;
if (constant->mConstType == BfConstType_Undef)
return false;
return true; return true;
} }

View file

@ -15752,7 +15752,7 @@ BfTypedValue BfModule::ReferenceStaticField(BfFieldInstance* fieldInstance)
{ {
// Just fake it for the extern and unspecialized modules // Just fake it for the extern and unspecialized modules
// We can't do this for compilation because unreified methods with default params need to get actual global variable refs // We can't do this for compilation because unreified methods with default params need to get actual global variable refs
return BfTypedValue(mBfIRBuilder->CreateConstNull(), fieldInstance->GetResolvedType(), true); return BfTypedValue(mBfIRBuilder->CreateUndefValue(mBfIRBuilder->GetPrimitiveType(BfTypeCode_NullPtr)), fieldInstance->GetResolvedType(), true);
} }
BfIRValue* globalValuePtr = NULL; BfIRValue* globalValuePtr = NULL;