1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-11 21:04:10 +02:00

TypeDef MemberSet fixes

This commit is contained in:
Brian Fiete 2021-12-28 13:10:52 -05:00
parent cfaeb875f8
commit 069e327850
3 changed files with 28 additions and 37 deletions

View file

@ -712,11 +712,9 @@ void BfTypeDef::FreeMembers()
void BfTypeDef::PopulateMemberSets()
{
if ((!mMethodSet.IsEmpty()) || (!mFieldSet.IsEmpty()) || (!mPropertySet.IsEmpty()))
return;
for (auto methodDef : mMethods)
while (mMethodSet.mSourceSize < mMethods.mSize)
{
auto methodDef = mMethods[mMethodSet.mSourceSize++];
BF_ASSERT(methodDef->mNextWithSameName == NULL);
BfMemberSetEntry* entry;
@ -724,11 +722,12 @@ void BfTypeDef::PopulateMemberSets()
{
methodDef->mNextWithSameName = (BfMethodDef*)entry->mMemberDef;
entry->mMemberDef = methodDef;
}
}
}
for (auto fieldDef : mFields)
while (mFieldSet.mSourceSize < mFields.mSize)
{
auto fieldDef = mFields[mFieldSet.mSourceSize++];
BF_ASSERT(fieldDef->mNextWithSameName == NULL);
BfMemberSetEntry* entry;
@ -739,8 +738,9 @@ void BfTypeDef::PopulateMemberSets()
}
}
for (auto propDef : mProperties)
while (mPropertySet.mSourceSize < mProperties.mSize)
{
auto propDef = mProperties[mPropertySet.mSourceSize++];
BF_ASSERT(propDef->mNextWithSameName == NULL);
BfMemberSetEntry* entry;
@ -767,30 +767,6 @@ void BfTypeDef::ClearMemberSets()
mPropertySet.Clear();
}
void BfTypeDef::ClearOldMemberSets()
{
if ((mMethodSet.mCount > 0) && (mMethods.mSize > mMethodSet.mCount))
{
for (auto entry : mMethodSet)
((BfMethodDef*)entry.mMemberDef)->mNextWithSameName = NULL;
mMethodSet.Clear();
}
if ((mFieldSet.mCount > 0) && (mFields.mSize > mFieldSet.mCount))
{
for (auto entry : mFieldSet)
((BfFieldDef*)entry.mMemberDef)->mNextWithSameName = NULL;
mFieldSet.Clear();
}
if ((mPropertySet.mCount > 0) && (mProperties.mSize > mPropertySet.mCount))
{
for (auto entry : mPropertySet)
((BfPropertyDef*)entry.mMemberDef)->mNextWithSameName = NULL;
mPropertySet.Clear();
}
}
BfTypeDef::~BfTypeDef()
{
BfLogSysM("BfTypeDef::~BfTypeDef %p\n", this);