[binutils-gdb] gas: .rept syntax check

Alan Modra amodra@sourceware.org
Tue Feb 17 00:47:02 GMT 2026


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=5223e6bc41ed3db6db4dcac9f30b57020abb45c9

commit 5223e6bc41ed3db6db4dcac9f30b57020abb45c9
Author: Alan Modra <amodra@gmail.com>
Date:   Tue Feb 17 09:57:34 2026 +1030

    gas: .rept syntax check
    
    Report an error for the following.
     .rept 10 haha
     .byte 0
     .endr
    
            * read.c (do_repeat): Call demand_empty_rest_of_line.

Diff:
---
 gas/read.c | 3 +++
 1 file changed, 3 insertions(+)

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))
     {


More information about the Binutils-cvs mailing list