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.
This commit is contained in:
Alan Modra 2016-04-02 17:17:26 +10:30
parent 5b8cf793a7
commit 62bd6b5fa4
2 changed files with 9 additions and 1 deletions

View 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...

View 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