]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Excessive gas .irpt count
authorAlan Modra <amodra@gmail.com>
Thu, 9 Jan 2025 04:37:49 +0000 (15:07 +1030)
committerAlan Modra <amodra@gmail.com>
Thu, 9 Jan 2025 04:53:21 +0000 (15:23 +1030)
There is a test in do_repeat to error on "negative" repeat counts.
Just at what value a ssize_t is negative of course depends on the
host.  Change the excessive repeat count to a fixed value, 0x80000000,
ie. what would be seen as negative on a 32-bit host.

gas/read.c
gas/testsuite/gas/macros/end.l

index 6d0d4b5e31a18a81ec47f6599fef0f1fa6ee4798..5df1f3da5885a8d89c7502612bded33f4265175b 100644 (file)
@@ -3144,9 +3144,9 @@ do_repeat (size_t count, const char *start, const char *end,
   sb one;
   sb many;
 
-  if (((ssize_t) count) < 0)
+  if (count > 0x7fffffff)
     {
-      as_bad (_("negative count for %s - ignored"), start);
+      as_bad (_("excessive count %zu for %s - ignored"), count, start);
       count = 0;
     }
 
index ff5d45213db519f5c1564000e4d1b438df586fd7..9e765cca0625d348388506e476c98a8f123d4362 100644 (file)
@@ -1,4 +1,4 @@
 .*: Assembler messages:
 .*:1: Warning: \.endm .* \.macro
 .*:2: Warning: \.endr .* (\.rept|\.irpc?).*(\.rept|\.irpc?).*(\.rept|\.irpc?)
-.*:3: Error: negative count for REPT - ignored
+.*:3: Error: .* for REPT - ignored