From: Nick Clifton Date: Tue, 14 Jul 2009 15:38:20 +0000 (+0000) Subject: PR 10387 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=63b33ceb0b1e4c8554b7d773d068819aa5ca2af6;p=binutils-gdb.git PR 10387 * config/tc-arm.h (THUMB_IS_FUNC): Handle a NULL pointer. (ARM_IS_FUNC): Likewise. --- diff --git a/gas/ChangeLog b/gas/ChangeLog index e8864c8e619..bf7dc296693 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,9 @@ +2009-07-14 Nick Clifton + + PR 10387 + * config/tc-arm.h (THUMB_IS_FUNC): Handle a NULL pointer. + (ARM_IS_FUNC): Likewise. + 2009-07-14 Daniel Gutson * config/tc-arm.c (md_assemble): Added validation. diff --git a/gas/config/tc-arm.h b/gas/config/tc-arm.h index 05841df9bca..47fce80d9f8 100644 --- a/gas/config/tc-arm.h +++ b/gas/config/tc-arm.h @@ -128,24 +128,26 @@ bfd_boolean arm_is_eabi (void); /* For ELF objects THUMB_IS_FUNC is inferred from ARM_IS_THUMB and the function type. */ -#define THUMB_IS_FUNC(s) \ - ((arm_is_eabi () \ - && (ARM_IS_THUMB (s)) \ - && (symbol_get_bfdsym (s)->flags & BSF_FUNCTION)) \ - || (ARM_GET_FLAG (s) & THUMB_FLAG_FUNC)) - -#define ARM_IS_FUNC(s) \ - ((arm_is_eabi () \ - && !(ARM_IS_THUMB (s)) \ - /* && !(THUMB_FLAG_FUNC & ARM_GET_FLAG (s)) \ */ \ +#define THUMB_IS_FUNC(s) \ + ((s) != NULL \ + && ((arm_is_eabi () \ + && (ARM_IS_THUMB (s)) \ + && (symbol_get_bfdsym (s)->flags & BSF_FUNCTION)) \ + || (ARM_GET_FLAG (s) & THUMB_FLAG_FUNC))) + +#define ARM_IS_FUNC(s) \ + (((s) != NULL \ + && arm_is_eabi () \ + && !(ARM_IS_THUMB (s)) \ + /* && !(THUMB_FLAG_FUNC & ARM_GET_FLAG (s)) \ */ \ && (symbol_get_bfdsym (s)->flags & BSF_FUNCTION))) #else -#define THUMB_IS_FUNC(s) (ARM_GET_FLAG (s) & THUMB_FLAG_FUNC) +#define THUMB_IS_FUNC(s) ((s) && ARM_GET_FLAG (s) & THUMB_FLAG_FUNC) #define ARM_IS_FUNC(s) (!THUMB_IS_FUNC (s) \ - && (symbol_get_bfdsym (s)->flags & BSF_FUNCTION)) + && (s) && (symbol_get_bfdsym (s)->flags & BSF_FUNCTION)) #endif #define ARM_SET_THUMB(s,t) ((t) ? ARM_SET_FLAG (s, ARM_FLAG_THUMB) : ARM_RESET_FLAG (s, ARM_FLAG_THUMB))