From 1e95f514696265c4941c2932bda3e2a59156a11f Mon Sep 17 00:00:00 2001 From: drmortalwombat <90205530+drmortalwombat@users.noreply.github.com> Date: Sat, 10 May 2025 08:33:02 +0200 Subject: [PATCH] Fix building object directly on call stack --- oscar64/InterCode.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/oscar64/InterCode.cpp b/oscar64/InterCode.cpp index 28692aa..d9fa09a 100644 --- a/oscar64/InterCode.cpp +++ b/oscar64/InterCode.cpp @@ -10752,15 +10752,15 @@ bool InterCodeBasicBlock::RemoveUnusedArgumentStoreInstructions(void) { mEntryRequiredArgs.Fill(); } - else if (ins->mCode == IC_STORE && ins->mSrc[1].mMemory == IM_FFRAME && ins->mSrc[1].mVarIndex + InterTypeSize[ins->mSrc[0].mType] < 64) + else if (ins->mCode == IC_STORE && ins->mSrc[1].mMemory == IM_FFRAME && ins->mSrc[1].mVarIndex + int(ins->mSrc[1].mIntConst) + 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 + int(ins->mSrc[1].mIntConst), InterTypeSize[ins->mSrc[0].mType])) { mInstructions.Remove(i); changed = true; } else - mEntryRequiredArgs.SubRange(ins->mSrc[1].mVarIndex, InterTypeSize[ins->mSrc[0].mType]); + mEntryRequiredArgs.SubRange(ins->mSrc[1].mVarIndex + int(ins->mSrc[1].mIntConst), InterTypeSize[ins->mSrc[0].mType]); } i--; } @@ -23506,7 +23506,7 @@ void InterCodeProcedure::Close(void) { GrowingTypeArray tstack(IT_NONE); - CheckFunc = !strcmp(mIdent->mString, "main"); + CheckFunc = !strcmp(mIdent->mString, "mbox::show"); CheckCase = false; mEntryBlock = mBlocks[0];