aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@access-company.com>2007-08-01 21:29:40 +0000
committerDJ Delorie <dj@gcc.gnu.org>2007-08-01 17:29:40 -0400
commitac847e32a09712fc25d668c84bcef3110aa6300b (patch)
treefd7aa45e02f987cfa525b5143852216b0b2a46dd
parent870c06b9d5b9d5771470b868232eeeb60f3d080a (diff)
downloadgcc-ac847e32a09712fc25d668c84bcef3110aa6300b.zip
gcc-ac847e32a09712fc25d668c84bcef3110aa6300b.tar.gz
gcc-ac847e32a09712fc25d668c84bcef3110aa6300b.tar.bz2
* cp-demangle.c (d_print_comp): Guard against null.
From-SVN: r127139
-rw-r--r--libiberty/ChangeLog4
-rw-r--r--libiberty/cp-demangle.c6
2 files changed, 10 insertions, 0 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index c1ef6d1..aee3cc7 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,7 @@
+2007-07-31 Michael Snyder <msnyder@access-company.com>
+
+ * cp-demangle.c (d_print_comp): Guard against null.
+
2007-07-25 Ben Elliston <bje@au.ibm.com>
* Makefile.in (CFILES): Remove ternary.c.
diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c
index 992b358..e4869f0 100644
--- a/libiberty/cp-demangle.c
+++ b/libiberty/cp-demangle.c
@@ -2912,6 +2912,12 @@ d_print_comp (struct d_print_info *dpi,
typed_name = d_left (typed_name);
}
+ if (typed_name == NULL)
+ {
+ d_print_error (dpi);
+ return;
+ }
+
/* If typed_name is a template, then it applies to the
function type as well. */
if (typed_name->type == DEMANGLE_COMPONENT_TEMPLATE)