segv in read_a_source_file

Message ID ZvswBBOA2LTai9z2@squeak.grove.modra.org
State New
Headers
Series segv in read_a_source_file |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_binutils_build--master-arm warning Patch is already merged
linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 warning Patch is already merged

Commit Message

Alan Modra Sept. 30, 2024, 11:11 p.m. UTC
  On some paths through read_a_source file, "s" may not be set.

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

Patch

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;