merge from gcc
authorDJ Delorie <dj@redhat.com>
Fri, 22 Sep 2006 19:19:32 +0000 (19:19 +0000)
committerDJ Delorie <dj@redhat.com>
Fri, 22 Sep 2006 19:19:32 +0000 (19:19 +0000)
libiberty/ChangeLog
libiberty/cp-demangle.c
libiberty/testsuite/demangle-expected

index 0705a14a5f0a4c3084e36ca095bd5135d0fb8fd2..5081525fc76fa7a602beb77f910230d6e380c0e3 100644 (file)
@@ -1,3 +1,9 @@
+2006-09-22  Ian Lance Taylor  <ian@airs.com>
+
+       PR other/29176
+       * cp-demangle.c (d_substitution): Check for overflow when
+       computing substitution index.
+
 2006-08-30  Corinna Vinschen  <corinna@vinschen.de>
 
        * configure.ac: Add case for Mingw as host.
index c7ee8786d9225031832c205a223aa2b4af0d6218..2fa59785f2fb130d08538891e53c25deb42492c8 100644 (file)
@@ -2505,6 +2505,8 @@ d_substitution (struct d_info *di, int prefix)
                id = id * 36 + c - 'A' + 10;
              else
                return NULL;
+             if (id < 0)
+               return NULL;
              c = d_next_char (di);
            }
          while (c != '_');
index 4aaa3d639ec34896228a1b8c40c65d01d03459bb..3f5622f79b75a19371b905bc99efea2266212e63 100644 (file)
@@ -3811,3 +3811,8 @@ make<Factory, int>
 _Z1fM1AKiPKS1_
 f(int const A::*, int const A::* const*)
 f
+# This used to cause a core dump in the demangler -- PR 29176
+--format=auto --no-params
+SASDASDFASDF_sdfsdf
+SASDASDFASDF_sdfsdf
+SASDASDFASDF_sdfsdf