summaryrefslogtreecommitdiff
path: root/gas/cgen.c
diff options
context:
space:
mode:
authorDJ Delorie <dj@delorie.com>2009-05-13 21:41:38 +0000
committerDJ Delorie <dj@delorie.com>2009-05-13 21:41:38 +0000
commit05889d03cde0521a578c57c5f40e3a0f98d86a53 (patch)
tree07692c48cc97715b44ebbc8bc0c23215287d24d6 /gas/cgen.c
parent28ab69eb445aa8b7ed49726f060d7460225099c5 (diff)
downloadbinutils-redhat-05889d03cde0521a578c57c5f40e3a0f98d86a53.tar.gz
* cgen.c (gas_cgen_parse_operand): Guard against NULL pointers.
Diffstat (limited to 'gas/cgen.c')
-rw-r--r--gas/cgen.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gas/cgen.c b/gas/cgen.c
index 178402af27..79a46f668a 100644
--- a/gas/cgen.c
+++ b/gas/cgen.c
@@ -452,9 +452,10 @@ gas_cgen_parse_operand (cd, want, strP, opindex, opinfo, resultP, valueP)
if (exp.X_op == O_symbol
&& reloc_type == BFD_RELOC_RELC
&& exp.X_add_symbol->sy_value.X_op == O_constant
- && exp.X_add_symbol->bsym->section != expr_section
- && exp.X_add_symbol->bsym->section != absolute_section
- && exp.X_add_symbol->bsym->section != undefined_section)
+ && (!exp.X_add_symbol->bsym
+ || (exp.X_add_symbol->bsym->section != expr_section
+ && exp.X_add_symbol->bsym->section != absolute_section
+ && exp.X_add_symbol->bsym->section != undefined_section)))
{
/* Local labels will have been (eagerly) turned into constants
by now, due to the inappropriately deep insight of the