diff --git a/src/ld65/config.c b/src/ld65/config.c index c22ced1ef..6606df7e3 100644 --- a/src/ld65/config.c +++ b/src/ld65/config.c @@ -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) { diff --git a/test/dasm/Makefile b/test/dasm/Makefile index d9ac7ac21..e84560ad2 100644 --- a/test/dasm/Makefile +++ b/test/dasm/Makefile @@ -30,7 +30,7 @@ ISEQUAL = ../../testwrk/isequal$(EXE) CC = gcc CFLAGS = -O2 -START = --start-addr 0x8000 +START = --start-addr 0x7000 .PHONY: all clean