Commit f433554b by Zack Weinberg Committed by Zack Weinberg

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
parent d6e57462
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> 2004-02-13 Ulrich Weigand <uweigand@de.ibm.com>
* config/s390/s390-protos.h (s390_output_symbolic_const): Remove. * config/s390/s390-protos.h (s390_output_symbolic_const): Remove.
......
...@@ -152,13 +152,15 @@ static const struct xcoff_type_number xcoff_type_numbers[] = { ...@@ -152,13 +152,15 @@ static const struct xcoff_type_number xcoff_type_numbers[] = {
int int
xcoff_assign_fundamental_type_number (tree decl) xcoff_assign_fundamental_type_number (tree decl)
{ {
const char *name = IDENTIFIER_POINTER (DECL_NAME (decl)); const char *name;
size_t i; size_t i;
/* Do not waste time searching the list for non-intrinsic types. */ /* 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; return 0;
name = IDENTIFIER_POINTER (DECL_NAME (decl));
/* Linear search, blech, but the list is too small to bother /* Linear search, blech, but the list is too small to bother
doing anything else. */ doing anything else. */
for (i = 0; i < ARRAY_SIZE (xcoff_type_numbers); i++) for (i = 0; i < ARRAY_SIZE (xcoff_type_numbers); i++)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment