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

Fixed dtor lookup

This commit is contained in:
Brian Fiete 2021-02-07 16:17:24 -08:00
parent eddbf7a984
commit 9268e3b25d
6 changed files with 73 additions and 37 deletions

View file

@ -1916,13 +1916,7 @@ void BfModule::AddStackAlloc(BfTypedValue val, BfIRValue arraySize, BfAstNode* r
bool hadDtorCall = false;
while (checkBaseType != NULL)
{
checkBaseType->mTypeDef->PopulateMemberSets();
BfMemberSetEntry* entry = NULL;
BfMethodDef* dtorMethodDef = NULL;
checkBaseType->mTypeDef->mMethodSet.TryGetWith(String("~this"), &entry);
if (entry != NULL)
dtorMethodDef = (BfMethodDef*)entry->mMemberDef;
BfMethodDef* dtorMethodDef = checkBaseType->mTypeDef->GetMethodByName("~this");
if (dtorMethodDef != NULL)
{
auto dtorMethodInstance = GetMethodInstance(checkBaseType, dtorMethodDef, BfTypeVector());
@ -15740,13 +15734,7 @@ void BfModule::EmitDtorBody()
UpdateSrcPos(typeDef->mTypeDeclaration->mNameNode);
}
checkBaseType->mTypeDef->PopulateMemberSets();
BfMemberSetEntry* entry = NULL;
BfMethodDef* dtorMethodDef = NULL;
checkBaseType->mTypeDef->mMethodSet.TryGetWith(String("~this"), &entry);
if (entry != NULL)
dtorMethodDef = (BfMethodDef*)entry->mMemberDef;
BfMethodDef* dtorMethodDef = checkBaseType->mTypeDef->GetMethodByName("~this");
if (dtorMethodDef != NULL)
{
auto dtorMethodInstance = GetMethodInstance(checkBaseType, dtorMethodDef, BfTypeVector());