Fix unused parameter optimization for deep call stacks

This commit is contained in:
drmortalwombat 2024-08-29 14:18:01 +02:00
parent da93410468
commit e7ec859dfc

View File

@ -10065,7 +10065,7 @@ bool InterCodeBasicBlock::RemoveUnusedArgumentStoreInstructions(void)
{ {
mEntryRequiredArgs.Fill(); mEntryRequiredArgs.Fill();
} }
else if (ins->mCode == IC_STORE && ins->mSrc[1].mMemory == IM_FFRAME) else if (ins->mCode == IC_STORE && ins->mSrc[1].mMemory == IM_FFRAME && ins->mSrc[1].mVarIndex + InterTypeSize[ins->mSrc[0].mType] < 64)
{ {
if (mEntryRequiredArgs.RangeClear(ins->mSrc[1].mVarIndex, InterTypeSize[ins->mSrc[0].mType])) if (mEntryRequiredArgs.RangeClear(ins->mSrc[1].mVarIndex, InterTypeSize[ins->mSrc[0].mType]))
{ {
@ -21917,7 +21917,7 @@ void InterCodeProcedure::Close(void)
{ {
GrowingTypeArray tstack(IT_NONE); GrowingTypeArray tstack(IT_NONE);
CheckFunc = !strcmp(mIdent->mString, "test"); CheckFunc = !strcmp(mIdent->mString, "main");
CheckCase = false; CheckCase = false;
mEntryBlock = mBlocks[0]; mEntryBlock = mBlocks[0];