[binutils-gdb] segv in read_a_source_file

Alan Modra amodra@sourceware.org
Mon Sep 30 23:23:20 GMT 2024


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

commit 444ae19249ac2d1221a01d87deb1aeceb535e5b4
Author: Alan Modra <amodra@gmail.com>
Date:   Tue Oct 1 08:00:32 2024 +0930

    segv in read_a_source_file
    
    On some paths through read_a_source file, "s" may not be set.
    
            * read.c (read_a_source_file): Correct code ignoring comment.

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

diff --git a/gas/read.c b/gas/read.c
index 71915eebd19..bc31d328a3d 100644
--- a/gas/read.c
+++ b/gas/read.c
@@ -1397,6 +1397,7 @@ read_a_source_file (const char *name)
 	  if (next_char && strchr (line_comment_chars, next_char))
 	    {
 	      /* Its a comment, ignore it.  Note: Not ignore_rest_of_line ()!  */
+	      s = input_line_pointer;
 	      while (s <= buffer_limit)
 		if (is_end_of_line (*s++))
 		  break;


More information about the Binutils-cvs mailing list