From a19469d851e53943c82c61af2322e5b218a2e47c Mon Sep 17 00:00:00 2001 From: drmortalwombat <90205530+drmortalwombat@users.noreply.github.com> Date: Tue, 16 Jan 2024 08:12:47 +0100 Subject: [PATCH] Fix exportet variable alignment calculation --- oscar64/InterCode.cpp | 5 ++++- oscar64/Parser.cpp | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/oscar64/InterCode.cpp b/oscar64/InterCode.cpp index 387ee77..a9130af 100644 --- a/oscar64/InterCode.cpp +++ b/oscar64/InterCode.cpp @@ -7348,6 +7348,9 @@ void InterCodeBasicBlock::UpdateLocalIntegerRangeSets(const GrowingVariableArray } break; + case IC_RELATIONAL_OPERATOR: + vr.SetLimit(0, 1); + break; case IC_BINARY_OPERATOR: switch (ins->mOperator) { @@ -19334,7 +19337,7 @@ void InterCodeProcedure::Close(void) { GrowingTypeArray tstack(IT_NONE); - CheckFunc = !strcmp(mIdent->mString, "rebuild_screen"); + CheckFunc = !strcmp(mIdent->mString, "main"); CheckCase = false; mEntryBlock = mBlocks[0]; diff --git a/oscar64/Parser.cpp b/oscar64/Parser.cpp index 8c59050..a65ad7c 100644 --- a/oscar64/Parser.cpp +++ b/oscar64/Parser.cpp @@ -4525,7 +4525,7 @@ Declaration* Parser::ParseDeclaration(Declaration * pdec, bool variable, bool ex if (mScope->mLevel < SLEVEL_FUNCTION || (ndec->mFlags & DTF_STATIC)) { if (ndec->mSize >= 256) - ndec->mAlignment = ndec->mBase->Alignment(); + ndec->mAlignment = ((ndec->mAlignment - 1) | (ndec->mBase->Alignment() - 1)) + 1; ndec->mFlags |= DTF_GLOBAL; ndec->mVarIndex = -1;