Correct error message for macro arg \<-INT_MIN>

This commit is contained in:
Rangi
2026-08-22 19:02:23 -04:00
parent e287ee2724
commit 9fa5058add
5 changed files with 6 additions and 8 deletions
+1 -1
View File
@@ -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;
}
+1 -2
View File
@@ -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
+1 -1
View File
@@ -8,7 +8,7 @@
0: ==
-8: ==
2147483647: ==
-2147483648: == >
-2147483648: ==
2147483648: == >
-1: G == G
4294967295: G == >
+2 -4
View File
@@ -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
+1
View File
@@ -11,3 +11,4 @@ $0
$A