Fix exportet variable alignment calculation

This commit is contained in:
drmortalwombat 2024-01-16 08:12:47 +01:00
parent 265be6e766
commit a19469d851
2 changed files with 5 additions and 2 deletions

View File

@ -7348,6 +7348,9 @@ void InterCodeBasicBlock::UpdateLocalIntegerRangeSets(const GrowingVariableArray
} }
break; break;
case IC_RELATIONAL_OPERATOR:
vr.SetLimit(0, 1);
break;
case IC_BINARY_OPERATOR: case IC_BINARY_OPERATOR:
switch (ins->mOperator) switch (ins->mOperator)
{ {
@ -19334,7 +19337,7 @@ void InterCodeProcedure::Close(void)
{ {
GrowingTypeArray tstack(IT_NONE); GrowingTypeArray tstack(IT_NONE);
CheckFunc = !strcmp(mIdent->mString, "rebuild_screen"); CheckFunc = !strcmp(mIdent->mString, "main");
CheckCase = false; CheckCase = false;
mEntryBlock = mBlocks[0]; mEntryBlock = mBlocks[0];

View File

@ -4525,7 +4525,7 @@ Declaration* Parser::ParseDeclaration(Declaration * pdec, bool variable, bool ex
if (mScope->mLevel < SLEVEL_FUNCTION || (ndec->mFlags & DTF_STATIC)) if (mScope->mLevel < SLEVEL_FUNCTION || (ndec->mFlags & DTF_STATIC))
{ {
if (ndec->mSize >= 256) if (ndec->mSize >= 256)
ndec->mAlignment = ndec->mBase->Alignment(); ndec->mAlignment = ((ndec->mAlignment - 1) | (ndec->mBase->Alignment() - 1)) + 1;
ndec->mFlags |= DTF_GLOBAL; ndec->mFlags |= DTF_GLOBAL;
ndec->mVarIndex = -1; ndec->mVarIndex = -1;