From: Alan Modra Date: Sat, 2 Apr 2016 06:47:26 +0000 (+1030) Subject: PR19896, Segmentation fault on bad input X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=62bd6b5fa4697a0feef745f3ea79a9f2a28c163f;p=binutils-gdb.git PR19896, Segmentation fault on bad input PR 19896 * read.c (assign_symbol): Consume rest of line after an error rather than continuing to process the line. --- diff --git a/gas/ChangeLog b/gas/ChangeLog index dce15a1f922..6c763918d53 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,9 @@ +2016-04-02 Alan Modra + + 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 * config/tc-arc.h (MAX_FLAG_NAME_LENGHT): Rename to... diff --git a/gas/read.c b/gas/read.c index 35d44c1aee6..a940ff3af92 100644 --- a/gas/read.c +++ b/gas/read.c @@ -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