OSDN Git Service

PR other/29176
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 22 Sep 2006 13:52:29 +0000 (13:52 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 22 Sep 2006 13:52:29 +0000 (13:52 +0000)
* cp-demangle.c (d_substitution): Check for overflow when
computing substitution index.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@117144 138bc75d-0d04-0410-961f-82ee72b054a4

libiberty/ChangeLog
libiberty/cp-demangle.c
libiberty/testsuite/demangle-expected

index 0705a14..5081525 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 c7ee878..2fa5978 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 4aaa3d6..3f5622f 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