mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 03:52:19 +02:00
Fixed Object alloc clearing with extensions
This commit is contained in:
parent
f0b5101a67
commit
6af0f111c0
2 changed files with 14 additions and 1 deletions
|
@ -20410,7 +20410,20 @@ void BfModule::ProcessMethod(BfMethodInstance* methodInstance, bool isInlineDup,
|
|||
auto thisVal = GetThis();
|
||||
int prevSize = 0;
|
||||
if (mContext->mBfObjectType != NULL)
|
||||
{
|
||||
prevSize = mContext->mBfObjectType->mInstSize;
|
||||
PopulateType(mContext->mBfObjectType);
|
||||
|
||||
// If we have object extensions, clear out starting at the extension
|
||||
for (auto& fieldInstance : mContext->mBfObjectType->mFieldInstances)
|
||||
{
|
||||
if (fieldInstance.GetFieldDef()->mDeclaringType->IsExtension())
|
||||
{
|
||||
prevSize = fieldInstance.mDataOffset;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
int curSize = mCurTypeInstance->mInstSize;
|
||||
if (curSize > prevSize)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue