mirror of
https://github.com/gbdev/rgbds.git
synced 2026-08-29 10:05:15 +00:00
Correct error message for macro arg \<-INT_MIN>
This commit is contained in:
+1
-1
@@ -542,7 +542,7 @@ static uint32_t readBracketedMacroArgNum() {
|
||||
}
|
||||
}
|
||||
uint32_t n = readNumber<10>(bumpChar(), nullptr);
|
||||
if (n > INT32_MAX) {
|
||||
if (n > INT32_MAX && !(negative && n == static_cast<uint32_t>(INT32_MAX) + 1)) {
|
||||
error("Number in bracketed macro argument is too large");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -12,9 +12,8 @@ error: Macro argument `\<2147483647>` not defined
|
||||
at negative-macro-args.asm::mac(11) <- negative-macro-args.asm(21)
|
||||
error: Macro argument `\<-2147483648>` not defined
|
||||
at negative-macro-args.asm::mac(14) <- negative-macro-args.asm(21)
|
||||
error: Number in bracketed macro argument is too large
|
||||
error: Macro argument `\<-2147483648>` not defined
|
||||
at negative-macro-args.asm::mac(14) <- negative-macro-args.asm(21)
|
||||
while expanding symbol `i`
|
||||
error: Macro argument `\<-2147483648>` not defined
|
||||
at negative-macro-args.asm::mac(15) <- negative-macro-args.asm(21)
|
||||
error: Number in bracketed macro argument is too large
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
0: ==
|
||||
-8: ==
|
||||
2147483647: ==
|
||||
-2147483648: == >
|
||||
-2147483648: ==
|
||||
2147483648: == >
|
||||
-1: G == G
|
||||
4294967295: G == >
|
||||
|
||||
@@ -12,8 +12,6 @@ error: Macro argument `\1` not defined
|
||||
at negative-shifted-macro-args.asm::test(15) <- negative-shifted-macro-args.asm(22)
|
||||
error: Macro argument `\<-1>` not defined
|
||||
at negative-shifted-macro-args.asm::test(16) <- negative-shifted-macro-args.asm(22)
|
||||
error: Number in bracketed macro argument is too large
|
||||
error: Macro argument `\<-2147483648>` not defined
|
||||
at negative-shifted-macro-args.asm::test(19) <- negative-shifted-macro-args.asm(22)
|
||||
error: syntax error, unexpected >
|
||||
at negative-shifted-macro-args.asm::test(19) <- negative-shifted-macro-args.asm(22)
|
||||
Assembly aborted with 9 errors
|
||||
Assembly aborted with 8 errors
|
||||
|
||||
@@ -11,3 +11,4 @@ $0
|
||||
|
||||
|
||||
$A
|
||||
|
||||
|
||||
Reference in New Issue
Block a user