gas: .rept syntax check

Alan Modra amodra@gmail.com
Mon Feb 16 23:31:03 GMT 2026


Report an error for the following.
 .rept 10 haha
 .byte 0
 .endr

	* read.c (do_repeat): Call demand_empty_rest_of_line.

diff --git a/gas/read.c b/gas/read.c
index 0939fe8d1e3..4f7420e4117 100644
--- a/gas/read.c
+++ b/gas/read.c
@@ -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))
     {

-- 
Alan Modra


More information about the Binutils mailing list