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++)
|
||||
{
|
||||
Declaration* vf = mVariableFunctions[i];
|
||||
CheckFastcall(vf, false);
|
||||
|
||||
if (vf->mBase->IsSame(cf))
|
||||
{
|
||||
CheckFastcall(vf, false);
|
||||
|
||||
int n = vf->mBase->mFastCallBase + vf->mBase->mFastCallSize;
|
||||
if (n > nbase)
|
||||
nbase = n;
|
||||
}
|
||||
|
||||
}
|
||||
// procDec->mFlags |= DTF_DYNSTACK;
|
||||
}
|
||||
|
|
|
@ -3503,7 +3503,7 @@ bool NativeCodeInstruction::ValueForwarding(NativeRegisterDataSet& data, AsmInsT
|
|||
}
|
||||
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];
|
||||
mAddress = data.mRegs[CPU_REG_A].mValue;
|
||||
|
@ -41410,7 +41410,7 @@ void NativeCodeProcedure::Optimize(void)
|
|||
|
||||
t++;
|
||||
|
||||
} while (changed);
|
||||
} while (changed && t < 20);
|
||||
#endif
|
||||
|
||||
BuildDataFlowSets();
|
||||
|
|
Loading…
Reference in New Issue