PR19896, Segmentation fault on bad input
authorAlan Modra <amodra@gmail.com>
Sat, 2 Apr 2016 06:47:26 +0000 (17:17 +1030)
committerAlan Modra <amodra@gmail.com>
Sat, 2 Apr 2016 07:01:36 +0000 (17:31 +1030)
PR 19896
* read.c (assign_symbol): Consume rest of line after an error
rather than continuing to process the line.

gas/ChangeLog
gas/read.c

index dce15a1f92223e1cee585f40a6b0197e8f088e81..6c763918d533a6e5c9ad52cc737ac4a273167c91 100644 (file)
@@ -1,3 +1,9 @@
+2016-04-02  Alan Modra  <amodra@gmail.com>
+
+       PR 19896
+       * read.c (assign_symbol): Consume rest of line after an error
+       rather than continuing to process the line.
+
 2016-04-01  Andrew Burgess  <andrew.burgess@embecosm.com>
 
        * config/tc-arc.h (MAX_FLAG_NAME_LENGHT): Rename to...
index 35d44c1aee614f2c6e17a6cca53178ac07de287c..a940ff3af9291669a63cca10249d2564988fe7ba 100644 (file)
@@ -3255,7 +3255,9 @@ assign_symbol (char *name, int mode)
          && !S_CAN_BE_REDEFINED (symbolP))
        {
          as_bad (_("symbol `%s' is already defined"), name);
-         symbolP = symbol_clone (symbolP, 0);
+         ignore_rest_of_line ();
+         input_line_pointer--;
+         return;
        }
       /* If the symbol is volatile, copy the symbol and replace the
         original with the copy, so that previous uses of the symbol will