]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gas: .rept syntax check
authorAlan Modra <amodra@gmail.com>
Mon, 16 Feb 2026 23:27:34 +0000 (09:57 +1030)
committerAlan Modra <amodra@gmail.com>
Tue, 17 Feb 2026 00:45:47 +0000 (11:15 +1030)
Report an error for the following.
 .rept 10 haha
 .byte 0
 .endr

* read.c (do_repeat): Call demand_empty_rest_of_line.

gas/read.c

index 0939fe8d1e30b1c73fc1a11d6f45da4430882da4..4f7420e4117b7f5a64c273f049ee2ff8681b2ae4 100644 (file)
@@ -3207,6 +3207,9 @@ do_repeat (size_t count, const char *start, const char *end,
       count = 0;
     }
 
+  demand_empty_rest_of_line ();
+  --input_line_pointer;
+
   sb_new (&one);
   if (!buffer_and_nest (start, end, &one, get_non_macro_line_sb))
     {