From 6d6ad65b43efa17a825702297331fcb290445a18 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Thu, 1 Dec 2016 10:38:40 +0000 Subject: Fix ICE in assembler when passed a corrupt input file. PR gas/20895 * symbols.c (resolve_symbol_value): Gracefully handle erroneous symbolic expressions. --- gas/symbols.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'gas/symbols.c') diff --git a/gas/symbols.c b/gas/symbols.c index 9115d7e..66865e0 100644 --- a/gas/symbols.c +++ b/gas/symbols.c @@ -1429,7 +1429,16 @@ resolve_symbol_value (symbolS *symp) case O_gt: left = left > right ? ~ (offsetT) 0 : 0; break; case O_logical_and: left = left && right; break; case O_logical_or: left = left || right; break; - default: abort (); + + case O_illegal: + case O_absent: + case O_constant: + /* See PR 20895 for a reproducer. */ + as_bad (_("Invalid operation on symbol")); + goto exit_dont_set_value; + + default: + abort (); } final_val += symp->sy_frag->fr_address + left; -- cgit v1.1