aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZack Weinberg <zack@codesourcery.com>2004-02-13 18:24:06 +0000
committerZack Weinberg <zack@gcc.gnu.org>2004-02-13 18:24:06 +0000
commitf433554b69c82905dcd4aa34ca94fee425a0e008 (patch)
tree2c9010bc816c89c320673aa7b8703775df9b9004
parentd6e57462de47c49af631496fb269fe1a9fb86d0f (diff)
downloadgcc-f433554b69c82905dcd4aa34ca94fee425a0e008.zip
gcc-f433554b69c82905dcd4aa34ca94fee425a0e008.tar.gz
gcc-f433554b69c82905dcd4aa34ca94fee425a0e008.tar.bz2
xcoffout.c (xcoff_assign_fundamental_type_number): Check DECL_NAME != 0 before dereferencing.
* xcoffout.c (xcoff_assign_fundamental_type_number): Check DECL_NAME != 0 before dereferencing. From-SVN: r77763
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/xcoffout.c6
2 files changed, 9 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d5a3ce4..b380083 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2004-02-13 Zack Weinberg <zack@codesourcery.com>
+
+ * xcoffout.c (xcoff_assign_fundamental_type_number): Check
+ DECL_NAME != 0 before dereferencing.
+
2004-02-13 Ulrich Weigand <uweigand@de.ibm.com>
* config/s390/s390-protos.h (s390_output_symbolic_const): Remove.
diff --git a/gcc/xcoffout.c b/gcc/xcoffout.c
index 447da74..de7528fb 100644
--- a/gcc/xcoffout.c
+++ b/gcc/xcoffout.c
@@ -152,13 +152,15 @@ static const struct xcoff_type_number xcoff_type_numbers[] = {
int
xcoff_assign_fundamental_type_number (tree decl)
{
- const char *name = IDENTIFIER_POINTER (DECL_NAME (decl));
+ const char *name;
size_t i;
/* Do not waste time searching the list for non-intrinsic types. */
- if (DECL_SOURCE_LINE (decl) > 0)
+ if (DECL_NAME (decl) == 0 || DECL_SOURCE_LINE (decl) > 0)
return 0;
+ name = IDENTIFIER_POINTER (DECL_NAME (decl));
+
/* Linear search, blech, but the list is too small to bother
doing anything else. */
for (i = 0; i < ARRAY_SIZE (xcoff_type_numbers); i++)