Prevent seg-fault in gas reading a binary input file.
authorNick Clifton <nickc@redhat.com>
Fri, 19 Feb 2016 13:19:57 +0000 (13:19 +0000)
committerNick Clifton <nickc@redhat.com>
Fri, 19 Feb 2016 13:19:57 +0000 (13:19 +0000)
PR 19630
* read.c (read_a_source_file): Check for assemble_one returning
with input_line_pointer set to NULL.

gas/ChangeLog
gas/read.c

index b1637a38ae7056a38d44acc599cb3ce708039183..d97a4b729c20baa8a151d4e6e6b050c60b4a73d7 100644 (file)
@@ -1,3 +1,9 @@
+2016-02-19  Nick Clifton  <nickc@redhat.com>
+
+       PR 19630
+       * read.c (read_a_source_file): Check for assemble_one returning
+       with input_line_pointer set to NULL.
+
 016-02-19  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>
 
        * listing.c (rebuffer_line): Change return type to void.
index 22da1df3061de11ae896792fc64ef4d0b6369a9b..5e0e3c8d99f0546ed6b9dc4b7babc2f1a6151ba5 100644 (file)
@@ -1176,6 +1176,11 @@ read_a_source_file (char *name)
 
                      assemble_one (s); /* Assemble 1 instruction.  */
 
+                     /* PR 19630: The backend may have set ilp to NULL
+                        if it encountered a catastrophic failure.  */
+                     if (input_line_pointer == NULL)
+                       as_fatal (_("unable to continue with assembly."));
                      *input_line_pointer++ = nul_char;
 
                      /* We resume loop AFTER the end-of-line from