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

Fixed issue with outer extension state change

This commit is contained in:
Brian Fiete 2020-01-19 07:35:17 -08:00
parent 04a93f0618
commit c7e41a30e4
5 changed files with 116 additions and 5 deletions

View file

@ -259,7 +259,10 @@ void BfGNUMangler::FindOrCreateNameSub(MangleContext& mangleContext, StringImpl&
if (useModule == NULL)
useModule = mangleContext.mModule;
auto outerType = useModule->GetOuterType(typeInst);
FindOrCreateNameSub(mangleContext, name, outerType, curMatchIdx, matchFailed);
if (outerType != NULL)
FindOrCreateNameSub(mangleContext, name, outerType, curMatchIdx, matchFailed);
else
useModule->Fail("Failed to mangle name in BfGNUMangler::FindOrCreateNameSub");
}
FindOrCreateNameSub(mangleContext, name, NameSubstitute(NameSubstitute::Kind_TypeInstName, typeInst), curMatchIdx, matchFailed);
@ -1283,7 +1286,10 @@ void BfMSMangler::Mangle(MangleContext& mangleContext, StringImpl& name, BfTypeI
else
{
auto outerType = useModule->GetOuterType(typeInstance);
Mangle(mangleContext, name, outerType, true, true);
if (outerType != NULL)
Mangle(mangleContext, name, outerType, true, true);
else
useModule->Fail("Failed to mangle name in BfMSMangler::Mangle");
}
}