Blame SOURCES/gcc32-demangle-pr16240.patch

4ac4fd
2004-06-28  Ian Lance Taylor  <ian@wasabisystems.com>
4ac4fd
4ac4fd
	PR other/16240
4ac4fd
	* cp-demangle.c (d_expr_primary): Check for a failure return from
4ac4fd
	cplus_demangle_type.
4ac4fd
	* testsuite/demangle-expected: Add test case.
4ac4fd
4ac4fd
--- libiberty/cp-demangle.c	25 Feb 2004 04:51:37 -0000	1.73
4ac4fd
+++ libiberty/cp-demangle.c	28 Jun 2004 15:23:33 -0000	1.74
4ac4fd
@@ -2398,6 +2398,8 @@ d_expr_primary (di)
4ac4fd
       const char *s;
4ac4fd
 
4ac4fd
       type = cplus_demangle_type (di);
4ac4fd
+      if (type == NULL)
4ac4fd
+	return NULL;
4ac4fd
 
4ac4fd
       /* If we have a type we know how to print, we aren't going to
4ac4fd
 	 print the type name itself.  */
4ac4fd
--- libiberty/testsuite/demangle-expected	25 Feb 2004 04:51:39 -0000	1.30
4ac4fd
+++ libiberty/testsuite/demangle-expected	28 Jun 2004 17:36:27 -0000	1.31
4ac4fd
@@ -3699,6 +3699,11 @@ _Z3fooIPA3_iEvRKT_
4ac4fd
 void foo<int (*) [3]>(int (* const&) [3])
4ac4fd
 foo<int (*) [3]>
4ac4fd
 #
4ac4fd
+# This used to crash the demangler--PR 16240
4ac4fd
+--format=gnu-v3 --no-params
4ac4fd
+_ZN13PatternDriver23StringScalarDeleteValueC1ERKNS_25ConflateStringScalarValueERKNS_25AbstractStringScalarValueERKNS_12TemplateEnumINS_12pdcomplementELZNS_16complement_namesEELZNS_14COMPLEMENTENUMEEEE
4ac4fd
+_ZN13PatternDriver23StringScalarDeleteValueC1ERKNS_25ConflateStringScalarValueERKNS_25AbstractStringScalarValueERKNS_12TemplateEnumINS_12pdcomplementELZNS_16complement_namesEELZNS_14COMPLEMENTENUMEEEE
4ac4fd
+PatternDriver::StringScalarDeleteValue::StringScalarDeleteValue
4ac4fd
 # Test GNU V3 constructor and destructor identification.
4ac4fd
 # 0 means it is not a constructor/destructor.
4ac4fd
 # Other integers correspond to enum gnu_v3_{c,d}tor_kinds in demangle.h.