diff options
author | J. Brobecker <brobecker@gnat.com> | 2003-10-20 23:21:30 +0000 |
---|---|---|
committer | Joel Brobecker <brobecke@gcc.gnu.org> | 2003-10-20 23:21:30 +0000 |
commit | 08c5b96d1b489be9307572412f16fa5f4f4ec73d (patch) | |
tree | c410c364acf6f3682b3033887a3663d841cccefe /libiberty | |
parent | 9540958eff5708adcb43b901c168ca00f8a86f3a (diff) | |
download | gcc-08c5b96d1b489be9307572412f16fa5f4f4ec73d.zip gcc-08c5b96d1b489be9307572412f16fa5f4f4ec73d.tar.gz gcc-08c5b96d1b489be9307572412f16fa5f4f4ec73d.tar.bz2 |
cplus-dem.c (demangle_template): Register a new Btype only when needed.
* cplus-dem.c (demangle_template): Register a new Btype only
when needed.
* testsuite/demangle-expected: Add a new test.
From-SVN: r72729
Diffstat (limited to 'libiberty')
-rw-r--r-- | libiberty/ChangeLog | 6 | ||||
-rw-r--r-- | libiberty/cplus-dem.c | 8 | ||||
-rw-r--r-- | libiberty/testsuite/demangle-expected | 6 |
3 files changed, 16 insertions, 4 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index 04aa508..6264fbf 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,9 @@ +2003-10-20 J. Brobecker <brobecker@gnat.com> + + * cplus-dem.c (demangle_template): Register a new Btype only + when needed. + * testsuite/demangle-expected: Add a new test. + 2003-10-16 H.J. Lu <hongjiu.lu@intel.com> * testsuite/demangle-expected: Update the expected output of diff --git a/libiberty/cplus-dem.c b/libiberty/cplus-dem.c index 59afcd3..5e2e7a7 100644 --- a/libiberty/cplus-dem.c +++ b/libiberty/cplus-dem.c @@ -2043,13 +2043,10 @@ demangle_template (work, mangled, tname, trawname, is_type, remember) const char *start; int is_java_array = 0; string temp; - int bindex = 0; (*mangled)++; if (is_type) { - if (remember) - bindex = register_Btype (work); start = *mangled; /* get template name */ if (**mangled == 'z') @@ -2226,7 +2223,10 @@ demangle_template (work, mangled, tname, trawname, is_type, remember) } if (is_type && remember) - remember_Btype (work, tname->b, LEN_STRING (tname), bindex); + { + const int bindex = register_Btype (work); + remember_Btype (work, tname->b, LEN_STRING (tname), bindex); + } /* if (work -> static_type) diff --git a/libiberty/testsuite/demangle-expected b/libiberty/testsuite/demangle-expected index dabcc19..8dfab8e 100644 --- a/libiberty/testsuite/demangle-expected +++ b/libiberty/testsuite/demangle-expected @@ -2864,3 +2864,9 @@ r(int (G::*)(), int (G::*)() const, G, int (H::*)(), int (G::*)(), what<G const> --format=auto __CPR212____ct__Q3_3std141list__tm__128_Q2_3edm41THandle__tm__26_Q2_4emid15EMparticleChunkQ2_3std68allocator__tm__51_Q2_3edmJ37J14const_iteratorFRCQ3_3std18list__tm__7_Z1ZZ2Z8iterator __CPR212____ct__Q3_3std141list__tm__128_Q2_3edm41THandle__tm__26_Q2_4emid15EMparticleChunkQ2_3std68allocator__tm__51_Q2_3edmJ37J14const_iteratorFRCQ3_3std18list__tm__7_Z1ZZ2Z8iterator +# +# This used to cause a crash. It doesn't follow the C++ encoding so +# the demangled name should be identical to the original symbol name. +--format=auto +_test_array__L_1__B23b___clean.6 +_test_array__L_1__B23b___clean.6 |