mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 20:12:21 +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
|
@ -16090,7 +16090,7 @@ void BeMCContext::Generate(BeFunction* function)
|
||||||
mDbgPreferredRegs[32] = X64Reg_R8;*/
|
mDbgPreferredRegs[32] = X64Reg_R8;*/
|
||||||
|
|
||||||
//mDbgPreferredRegs[8] = X64Reg_RAX;
|
//mDbgPreferredRegs[8] = X64Reg_RAX;
|
||||||
mDebugging = (function->mName == "?Main@TestProgram@BeefTest@bf@@SATint@@PEAV?$Array1@PEAVString@System@bf@@@System@3@@Z");
|
//mDebugging = (function->mName == "?Main@TestProgram@BeefTest@bf@@SATint@@PEAV?$Array1@PEAVString@System@bf@@@System@3@@Z");
|
||||||
// || (function->mName == "?MethodA@TestProgram@BeefTest@bf@@CAXXZ");
|
// || (function->mName == "?MethodA@TestProgram@BeefTest@bf@@CAXXZ");
|
||||||
// || (function->mName == "?Hey@Blurg@bf@@SAXXZ")
|
// || (function->mName == "?Hey@Blurg@bf@@SAXXZ")
|
||||||
// ;
|
// ;
|
||||||
|
|
|
@ -20410,7 +20410,20 @@ void BfModule::ProcessMethod(BfMethodInstance* methodInstance, bool isInlineDup,
|
||||||
auto thisVal = GetThis();
|
auto thisVal = GetThis();
|
||||||
int prevSize = 0;
|
int prevSize = 0;
|
||||||
if (mContext->mBfObjectType != NULL)
|
if (mContext->mBfObjectType != NULL)
|
||||||
|
{
|
||||||
prevSize = mContext->mBfObjectType->mInstSize;
|
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;
|
int curSize = mCurTypeInstance->mInstSize;
|
||||||
if (curSize > prevSize)
|
if (curSize > prevSize)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue