mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 03:52:19 +02:00
Fixed invalid enum const type finalization with non-enum-case const
This commit is contained in:
parent
2c00929751
commit
1efd403472
1 changed files with 7 additions and 6 deletions
|
@ -3800,12 +3800,13 @@ void BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
|
|||
for (auto& fieldInstanceRef : typeInstance->mFieldInstances)
|
||||
{
|
||||
auto fieldInstance = &fieldInstanceRef;
|
||||
if (fieldInstance->mConstIdx != -1)
|
||||
{
|
||||
auto constant = typeInstance->mConstHolder->GetConstantById(fieldInstance->mConstIdx);
|
||||
BfIRValue newConstant = typeInstance->mConstHolder->CreateConst(typeCode, constant->mUInt64);
|
||||
fieldInstance->mConstIdx = newConstant.mId;
|
||||
}
|
||||
if (fieldInstance->mConstIdx == -1)
|
||||
continue;
|
||||
if (!fieldInstance->GetFieldDef()->IsEnumCaseEntry())
|
||||
continue;
|
||||
auto constant = typeInstance->mConstHolder->GetConstantById(fieldInstance->mConstIdx);
|
||||
BfIRValue newConstant = typeInstance->mConstHolder->CreateConst(typeCode, constant->mUInt64);
|
||||
fieldInstance->mConstIdx = newConstant.mId;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue