mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 04:22:20 +02:00
Fixed base-call append alloc
This commit is contained in:
parent
9eb3d8c3a5
commit
585e2575e8
1 changed files with 8 additions and 2 deletions
|
@ -420,7 +420,7 @@ public:
|
||||||
{
|
{
|
||||||
mFailed = false;
|
mFailed = false;
|
||||||
mIsFirstConstPass = false;
|
mIsFirstConstPass = false;
|
||||||
mCurAppendAlign = 0;
|
mCurAppendAlign = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmitAppendAlign(int align, int sizeMultiple = 0)
|
void EmitAppendAlign(int align, int sizeMultiple = 0)
|
||||||
|
@ -702,7 +702,7 @@ public:
|
||||||
|
|
||||||
auto calcAppendMethodModule = mModule->GetMethodInstanceAtIdx(bindResult.mMethodInstance->GetOwner(), bindResult.mMethodInstance->mMethodDef->mIdx + 1, BF_METHODNAME_CALCAPPEND);
|
auto calcAppendMethodModule = mModule->GetMethodInstanceAtIdx(bindResult.mMethodInstance->GetOwner(), bindResult.mMethodInstance->mMethodDef->mIdx + 1, BF_METHODNAME_CALCAPPEND);
|
||||||
|
|
||||||
auto subDependSize = mModule->TryConstCalcAppend(bindResult.mMethodInstance, calcAppendArgs);
|
auto subDependSize = mModule->TryConstCalcAppend(calcAppendMethodModule.mMethodInstance, calcAppendArgs);
|
||||||
if (calcAppendMethodModule.mMethodInstance->mAppendAllocAlign > 0)
|
if (calcAppendMethodModule.mMethodInstance->mAppendAllocAlign > 0)
|
||||||
{
|
{
|
||||||
EmitAppendAlign(calcAppendMethodModule.mMethodInstance->mAppendAllocAlign);
|
EmitAppendAlign(calcAppendMethodModule.mMethodInstance->mAppendAllocAlign);
|
||||||
|
@ -14760,6 +14760,8 @@ BfTypedValue BfModule::TryConstCalcAppend(BfMethodInstance* methodInst, SizedArr
|
||||||
{
|
{
|
||||||
BP_ZONE("BfModule::TryConstCalcAppend");
|
BP_ZONE("BfModule::TryConstCalcAppend");
|
||||||
|
|
||||||
|
BF_ASSERT(methodInst->mMethodDef->mMethodType == BfMethodType_CtorCalcAppend);
|
||||||
|
|
||||||
if ((mCompiler->mIsResolveOnly) && (!mIsConstModule))
|
if ((mCompiler->mIsResolveOnly) && (!mIsConstModule))
|
||||||
return BfTypedValue();
|
return BfTypedValue();
|
||||||
|
|
||||||
|
@ -14895,7 +14897,11 @@ BfTypedValue BfModule::TryConstCalcAppend(BfMethodInstance* methodInst, SizedArr
|
||||||
if (!appendAllocVisitor.mFailed)
|
if (!appendAllocVisitor.mFailed)
|
||||||
constValue = appendAllocVisitor.mConstAccum;
|
constValue = appendAllocVisitor.mConstAccum;
|
||||||
if (isFirstRun)
|
if (isFirstRun)
|
||||||
|
{
|
||||||
mCurMethodInstance->mEndingAppendAllocAlign = appendAllocVisitor.mCurAppendAlign;
|
mCurMethodInstance->mEndingAppendAllocAlign = appendAllocVisitor.mCurAppendAlign;
|
||||||
|
if (mCurMethodInstance->mAppendAllocAlign <= 0)
|
||||||
|
mCurMethodInstance->mAppendAllocAlign = 1;
|
||||||
|
}
|
||||||
|
|
||||||
if (isFirstRun)
|
if (isFirstRun)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue