Merge pull request #1996 from bbbradsmith/negative_memory_size_error
ld65 error if computed memory size is negative
This commit is contained in:
@@ -1936,6 +1936,11 @@ unsigned CfgProcess (void)
|
|||||||
GetString (M->Name));
|
GetString (M->Name));
|
||||||
}
|
}
|
||||||
M->Size = GetExprVal (M->SizeExpr);
|
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 */
|
/* Walk through the segments in this memory area */
|
||||||
for (J = 0; J < CollCount (&M->SegList); ++J) {
|
for (J = 0; J < CollCount (&M->SegList); ++J) {
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ ISEQUAL = ../../testwrk/isequal$(EXE)
|
|||||||
CC = gcc
|
CC = gcc
|
||||||
CFLAGS = -O2
|
CFLAGS = -O2
|
||||||
|
|
||||||
START = --start-addr 0x8000
|
START = --start-addr 0x7000
|
||||||
|
|
||||||
.PHONY: all clean
|
.PHONY: all clean
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user