1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-09 03:52:19 +02:00

Prevent comptime from setting mHasBeenInstantiated

This commit is contained in:
Brian Fiete 2022-06-13 09:57:23 -07:00
parent ab494ad8d4
commit d9e97c7dc0
2 changed files with 5 additions and 4 deletions

View file

@ -5800,13 +5800,14 @@ void BfCompiler::PopulateReified()
}
}
}
// Only check virtual stuff if we have been instantiated
if ((typeInst->HasBeenInstantiated()) && (!mCanceling))
{
// If we have any virtual methods overrides that are unreified but the declaring virtual method is reified then we also need to reify
for (auto&& vEntry : typeInst->mVirtualMethodTable)
// If we have any virtual methods overrides that are unreified but the declaring virtual method is reified then we also need to reify
for (int virtIdx = 0; virtIdx < typeInst->mVirtualMethodTable.mSize; virtIdx++)
{
auto& vEntry = typeInst->mVirtualMethodTable[virtIdx];
if ((vEntry.mDeclaringMethod.mTypeInstance == NULL) ||
(vEntry.mDeclaringMethod.mTypeInstance->IsIncomplete()) ||
(vEntry.mImplementingMethod.mTypeInstance == NULL) ||

View file

@ -9177,7 +9177,7 @@ BfIRValue BfModule::AllocFromType(BfType* type, const BfAllocTarget& allocTarget
int allocAlign = type->mAlign;
if (typeInstance != NULL)
{
if (!mBfIRBuilder->mIgnoreWrites)
if ((!mBfIRBuilder->mIgnoreWrites) && (!mIsComptimeModule))
typeInstance->mHasBeenInstantiated = true;
allocSize = typeInstance->mInstSize;
allocAlign = typeInstance->mInstAlign;