[binutils-gdb] tc-i386.c s_insn and input_line_pointer

Alan Modra via Binutils-cvs <[email protected]>
Newsgroups gmane.comp.gnu.binutils.cvs
Message-ID <[email protected]>
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=af373d1a1a023a12b107230eb4ebd33ca3e7f57b

commit af373d1a1a023a12b107230eb4ebd33ca3e7f57b
Author: Alan Modra <[email protected]>
Date:   Mon Apr 20 10:01:17 2026 +0930

    tc-i386.c s_insn and input_line_pointer
    
    A comment in check_Scc_OszcOperations says:
          /* No need to save/restore input_line_pointer; that's done in the
             caller already.  */
    That isn't true always.  Fix a case where input_line_pointer is not
    restored and ignore_rest_of_line() accesses a wild pointer.
    
            * gas/config/tc-i386.c (s_insn <bad>): Restore input_line_pointer.

Diff:
---
 gas/config/tc-i386.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 5ce83b0ac71..988b024f0b8 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -13568,6 +13568,7 @@ s_insn (int dummy ATTRIBUTE_UNUSED)
     {
   bad:
       *saved_ilp = saved_char;
+      input_line_pointer = saved_ilp;
       ignore_rest_of_line ();
       i.tm.mnem_off = 0;
       memset (&pp, 0, sizeof (pp));
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.