]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
segv in read_a_source_file
authorAlan Modra <amodra@gmail.com>
Mon, 30 Sep 2024 22:30:32 +0000 (08:00 +0930)
committerAlan Modra <amodra@gmail.com>
Mon, 30 Sep 2024 23:05:00 +0000 (08:35 +0930)
On some paths through read_a_source file, "s" may not be set.

* read.c (read_a_source_file): Correct code ignoring comment.

gas/read.c

index 71915eebd19562374f5ee8e8a3af26080f08dda4..bc31d328a3da6d6acaec9c2de2b5acb50e0c9c94 100644 (file)
@@ -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;