Fix over eager const pointer forwarding

This commit is contained in:
drmortalwombat 2024-06-16 09:01:36 +02:00
parent b428b608b5
commit 277afd156d
3 changed files with 5 additions and 2 deletions

View File

@ -239,6 +239,7 @@ void iec_talk(char dev, char sec)
iec_atn(dev | 0x40, sec | 0x60); iec_atn(dev | 0x40, sec | 0x60);
clock_true(); clock_true();
data_false();
delay(10); delay(10);
} }

View File

@ -964,7 +964,9 @@ Expression* Expression::ConstantFold(Errors * errors, LinkerSection * dataSectio
ex->mDecType = mLeft->mDecType; ex->mDecType = mLeft->mDecType;
return ex; return ex;
} }
else if (mType == EX_BINARY && mToken == TK_ADD && mLeft->mType == EX_VARIABLE && mLeft->mDecValue->mType == DT_VARIABLE && (mLeft->mDecValue->mFlags & DTF_CONST) && mLeft->mDecType->mType == DT_TYPE_POINTER && mRight->mType == EX_CONSTANT && mRight->mDecValue->mType == DT_CONST_INTEGER) else if (mType == EX_BINARY && mToken == TK_ADD && mLeft->mType == EX_VARIABLE && mLeft->mDecValue->mType == DT_VARIABLE && (mLeft->mDecValue->mFlags & DTF_CONST) &&
mLeft->mDecValue->mValue->mType == EX_CONSTANT &&
mLeft->mDecType->mType == DT_TYPE_POINTER && mRight->mType == EX_CONSTANT && mRight->mDecValue->mType == DT_CONST_INTEGER)
{ {
mLeft = mLeft->mDecValue->mValue; mLeft = mLeft->mDecValue->mValue;
return this->ConstantFold(errors, dataSection); return this->ConstantFold(errors, dataSection);

View File

@ -21016,7 +21016,7 @@ void InterCodeProcedure::Close(void)
{ {
GrowingTypeArray tstack(IT_NONE); GrowingTypeArray tstack(IT_NONE);
CheckFunc = !strcmp(mIdent->mString, "main"); CheckFunc = !strcmp(mIdent->mString, "__drawScreen__");
CheckCase = false; CheckCase = false;
mEntryBlock = mBlocks[0]; mEntryBlock = mBlocks[0];