Fix stack allocation with false recursion with function pointers
This commit is contained in:
parent
b1a42e5ecf
commit
ec15336174
|
@ -297,14 +297,16 @@ void GlobalAnalyzer::CheckFastcall(Declaration* procDec, bool head)
|
||||||
for (int i = 0; i < mVariableFunctions.Size(); i++)
|
for (int i = 0; i < mVariableFunctions.Size(); i++)
|
||||||
{
|
{
|
||||||
Declaration* vf = mVariableFunctions[i];
|
Declaration* vf = mVariableFunctions[i];
|
||||||
CheckFastcall(vf, false);
|
|
||||||
|
|
||||||
if (vf->mBase->IsSame(cf))
|
if (vf->mBase->IsSame(cf))
|
||||||
{
|
{
|
||||||
|
CheckFastcall(vf, false);
|
||||||
|
|
||||||
int n = vf->mBase->mFastCallBase + vf->mBase->mFastCallSize;
|
int n = vf->mBase->mFastCallBase + vf->mBase->mFastCallSize;
|
||||||
if (n > nbase)
|
if (n > nbase)
|
||||||
nbase = n;
|
nbase = n;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
// procDec->mFlags |= DTF_DYNSTACK;
|
// procDec->mFlags |= DTF_DYNSTACK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3503,7 +3503,7 @@ bool NativeCodeInstruction::ValueForwarding(NativeRegisterDataSet& data, AsmInsT
|
||||||
}
|
}
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
else if (data.mRegs[mAddress].mMode == NRDM_ZERO_PAGE)
|
else if (data.mRegs[mAddress].mMode == NRDM_ZERO_PAGE && (mAddress < BC_REG_FPARAMS || mAddress >= BC_REG_FPARAMS_END))
|
||||||
{
|
{
|
||||||
data.mRegs[CPU_REG_A] = data.mRegs[mAddress];
|
data.mRegs[CPU_REG_A] = data.mRegs[mAddress];
|
||||||
mAddress = data.mRegs[CPU_REG_A].mValue;
|
mAddress = data.mRegs[CPU_REG_A].mValue;
|
||||||
|
@ -41410,7 +41410,7 @@ void NativeCodeProcedure::Optimize(void)
|
||||||
|
|
||||||
t++;
|
t++;
|
||||||
|
|
||||||
} while (changed);
|
} while (changed && t < 20);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
BuildDataFlowSets();
|
BuildDataFlowSets();
|
||||||
|
|
Loading…
Reference in New Issue