Fix missing error in const function return

This commit is contained in:
drmortalwombat 2024-09-18 22:33:40 +02:00
parent 8bd5ec76c3
commit 40001164d4
2 changed files with 9 additions and 1 deletions

View File

@ -160,6 +160,7 @@ bool GlobalOptimizer::CheckConstReturns(Expression*& exp)
lexp->mRight->mToken = TK_MUL; lexp->mRight->mToken = TK_MUL;
lexp->mRight->mLeft = pex; lexp->mRight->mLeft = pex;
lexp->mRight->mDecType = pcall->mBase->mBase; lexp->mRight->mDecType = pcall->mBase->mBase;
lexp->mDecType = lexp->mRight->mDecType;
exp->mDecType = TheVoidTypeDeclaration; exp->mDecType = TheVoidTypeDeclaration;
exp = lexp; exp = lexp;
return true; return true;

View File

@ -13579,6 +13579,13 @@ bool InterCodeBasicBlock::RecheckOuterFrame(void)
if (ins->mSrc[1].mMemory == IM_FRAME) if (ins->mSrc[1].mMemory == IM_FRAME)
return true; return true;
} }
else if (ins->mCode == IC_COPY)
{
if (ins->mSrc[0].mMemory == IM_FRAME)
return true;
if (ins->mSrc[1].mMemory == IM_FRAME)
return true;
}
else if (ins->mCode == IC_CONSTANT) else if (ins->mCode == IC_CONSTANT)
{ {
if (ins->mConst.mType == IT_POINTER && ins->mConst.mMemory == IM_FRAME) if (ins->mConst.mType == IT_POINTER && ins->mConst.mMemory == IM_FRAME)
@ -22067,7 +22074,7 @@ void InterCodeProcedure::Close(void)
{ {
GrowingTypeArray tstack(IT_NONE); GrowingTypeArray tstack(IT_NONE);
CheckFunc = !strcmp(mIdent->mString, "f"); CheckFunc = !strcmp(mIdent->mString, "bar2");
CheckCase = false; CheckCase = false;
mEntryBlock = mBlocks[0]; mEntryBlock = mBlocks[0];