1
0
mirror of https://github.com/cc65/cc65.git synced 2024-11-19 06:31:31 +00:00

error if computed memory size is negative

This commit is contained in:
bbbradsmith 2023-02-19 09:01:17 -05:00
parent c097401f8b
commit 5bc8ff98de

View File

@ -1936,6 +1936,11 @@ unsigned CfgProcess (void)
GetString (M->Name));
}
M->Size = GetExprVal (M->SizeExpr);
if (M->Size >= 0x80000000) {
CfgError (GetSourcePos (M->LI),
"Size of memory area '%s' is negative: %ld",
GetString (M->Name), (long)M->Size);
}
/* Walk through the segments in this memory area */
for (J = 0; J < CollCount (&M->SegList); ++J) {