mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 12:32:20 +02:00
Fixed GC marking of fields in object extension
This commit is contained in:
parent
9ca48c26f2
commit
b0f019fdd3
1 changed files with 13 additions and 1 deletions
|
@ -18891,7 +18891,19 @@ void BfModule::EmitGCMarkMembers()
|
|||
if (moduleMethodInst)
|
||||
{
|
||||
auto methodBaseType = moduleMethodInst.mMethodInstance->GetOwner();
|
||||
if (methodBaseType != mContext->mBfObjectType)
|
||||
bool wantsBaseMarking = true;
|
||||
if (methodBaseType == mContext->mBfObjectType)
|
||||
{
|
||||
PopulateType(methodBaseType);
|
||||
for (auto& fieldInstance : mContext->mBfObjectType->mFieldInstances)
|
||||
{
|
||||
if ((fieldInstance.GetFieldDef()->mDeclaringType->IsExtension()) &&
|
||||
(fieldInstance.mResolvedType->WantsGCMarking()))
|
||||
wantsBaseMarking = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (wantsBaseMarking)
|
||||
{
|
||||
auto thisValue = GetThis();
|
||||
auto baseValue = Cast(NULL, thisValue, methodBaseType, BfCastFlags_Explicit);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue