Fix temp spilling in recursive functions

This commit is contained in:
drmortalwombat 2025-03-24 08:56:03 +01:00
parent e6bc6371c9
commit 2db8890453
2 changed files with 8 additions and 1 deletions

View File

@ -39,6 +39,13 @@ namespace opp {
v = k;
}
void operator-=(int k)
{
k = v - k;
__assume(k >= tmin && k <= tmax);
v = k;
}
operator int() const
{
int k = v;

View File

@ -5971,7 +5971,7 @@ InterCodeProcedure* InterCodeGenerator::TranslateProcedure(InterCodeModule * mod
if (dec->mFlags & DTF_FUNC_INTRCALLED)
proc->mInterruptCalled = true;
if (dec->mFlags & DTF_DYNSTACK)
if ((dec->mFlags & DTF_DYNSTACK) || (dec->mFlags & DTF_FUNC_RECURSIVE))
proc->mDynamicStack = true;
if ((dec->mFlags & DTF_PREVENT_INLINE) || (dec->mBase->mFlags & DTF_VARIADIC))