mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 11:38:21 +02:00
Compile QueueUnused modify-while-iterating fix
This commit is contained in:
parent
b1717a0722
commit
e606b18a0c
1 changed files with 28 additions and 21 deletions
|
@ -7045,6 +7045,8 @@ bool BfCompiler::DoCompile(const StringImpl& outputDirectory)
|
|||
mContext->mUnreifiedModule->ResolveTypeDef(typeDef, BfPopulateType_Full);
|
||||
}
|
||||
|
||||
Array<BfTypeInstance*> typeWorkList;
|
||||
|
||||
for (auto type : mContext->mResolvedTypes)
|
||||
{
|
||||
auto module = type->GetModule();
|
||||
|
@ -7067,27 +7069,32 @@ bool BfCompiler::DoCompile(const StringImpl& outputDirectory)
|
|||
|
||||
if (!typeInst->IsSpecializedType())
|
||||
{
|
||||
// Find any remaining methods for unreified processing
|
||||
for (auto&& methodInstGroup : typeInst->mMethodInstanceGroups)
|
||||
typeWorkList.Add(typeInst);
|
||||
}
|
||||
}
|
||||
|
||||
for (auto typeInst : typeWorkList)
|
||||
{
|
||||
// Find any remaining methods for unreified processing
|
||||
for (auto&& methodInstGroup : typeInst->mMethodInstanceGroups)
|
||||
{
|
||||
if ((methodInstGroup.mOnDemandKind == BfMethodOnDemandKind_Decl_AwaitingReference) ||
|
||||
(methodInstGroup.mOnDemandKind == BfMethodOnDemandKind_NoDecl_AwaitingReference))
|
||||
{
|
||||
if ((methodInstGroup.mOnDemandKind == BfMethodOnDemandKind_Decl_AwaitingReference) ||
|
||||
(methodInstGroup.mOnDemandKind == BfMethodOnDemandKind_NoDecl_AwaitingReference))
|
||||
if ((methodInstGroup.mDefault != NULL) && (methodInstGroup.mDefault->mIsForeignMethodDef))
|
||||
{
|
||||
if ((methodInstGroup.mDefault != NULL) && (methodInstGroup.mDefault->mIsForeignMethodDef))
|
||||
{
|
||||
mContext->mUnreifiedModule->GetMethodInstance(typeInst, methodInstGroup.mDefault->mMethodDef, BfTypeVector(),
|
||||
(BfGetMethodInstanceFlags)(BfGetMethodInstanceFlag_ForeignMethodDef | BfGetMethodInstanceFlag_UnspecializedPass | BfGetMethodInstanceFlag_ExplicitResolveOnlyPass));
|
||||
queuedMoreMethods = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
auto methodDef = typeInst->mTypeDef->mMethods[methodInstGroup.mMethodIdx];
|
||||
if (methodDef->mMethodType == BfMethodType_Init)
|
||||
continue;
|
||||
mContext->mUnreifiedModule->GetMethodInstance(typeInst, methodDef, BfTypeVector(),
|
||||
(BfGetMethodInstanceFlags)(BfGetMethodInstanceFlag_UnspecializedPass | BfGetMethodInstanceFlag_ExplicitResolveOnlyPass));
|
||||
queuedMoreMethods = true;
|
||||
}
|
||||
mContext->mUnreifiedModule->GetMethodInstance(typeInst, methodInstGroup.mDefault->mMethodDef, BfTypeVector(),
|
||||
(BfGetMethodInstanceFlags)(BfGetMethodInstanceFlag_ForeignMethodDef | BfGetMethodInstanceFlag_UnspecializedPass | BfGetMethodInstanceFlag_ExplicitResolveOnlyPass));
|
||||
queuedMoreMethods = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
auto methodDef = typeInst->mTypeDef->mMethods[methodInstGroup.mMethodIdx];
|
||||
if (methodDef->mMethodType == BfMethodType_Init)
|
||||
continue;
|
||||
mContext->mUnreifiedModule->GetMethodInstance(typeInst, methodDef, BfTypeVector(),
|
||||
(BfGetMethodInstanceFlags)(BfGetMethodInstanceFlag_UnspecializedPass | BfGetMethodInstanceFlag_ExplicitResolveOnlyPass));
|
||||
queuedMoreMethods = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue