diff options
author | Nick Clifton <nickc@redhat.com> | 2009-07-14 15:38:20 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2009-07-14 15:38:20 +0000 |
commit | 63b33ceb0b1e4c8554b7d773d068819aa5ca2af6 (patch) | |
tree | 1395daf49959f2030520ce817455669f71b12aea /gas/config/tc-arm.h | |
parent | b101f7a1257f10f7e9d596bef5c59b4ae082f4ab (diff) | |
download | gdb-63b33ceb0b1e4c8554b7d773d068819aa5ca2af6.zip gdb-63b33ceb0b1e4c8554b7d773d068819aa5ca2af6.tar.gz gdb-63b33ceb0b1e4c8554b7d773d068819aa5ca2af6.tar.bz2 |
PR 10387
* config/tc-arm.h (THUMB_IS_FUNC): Handle a NULL pointer.
(ARM_IS_FUNC): Likewise.
Diffstat (limited to 'gas/config/tc-arm.h')
-rw-r--r-- | gas/config/tc-arm.h | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/gas/config/tc-arm.h b/gas/config/tc-arm.h index 05841df..47fce80 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)) |