From db80fc3f1add0d1d105ce7569fb6fbedebf40b7f Mon Sep 17 00:00:00 2001 From: hjl Date: Sun, 10 Jan 2010 00:24:52 +0000 Subject: [PATCH] Return dgs.alc on success libiberty/ 2010-01-09 Ian Lance Taylor PR other/42230 * cp-demangle.c (d_demangle): Return dgs.alc on success. libstdc++-v3/ 2010-01-09 H.J. Lu PR other/42230 * testsuite/abi/pr42230.cc: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@155785 138bc75d-0d04-0410-961f-82ee72b054a4 --- libiberty/ChangeLog | 5 +++++ libiberty/cp-demangle.c | 2 +- libstdc++-v3/ChangeLog | 9 +++++++-- libstdc++-v3/testsuite/abi/pr42230.cc | 16 ++++++++++++++++ 4 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 libstdc++-v3/testsuite/abi/pr42230.cc diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index c3d8f196b27..effb327ea22 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,8 @@ +2010-01-09 Ian Lance Taylor + + PR other/42230 + * cp-demangle.c (d_demangle): Return dgs.alc on success. + 2010-01-04 Nobuhiro Iwamatsu PR target/42316 diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c index 43cf34a36cf..d37c90efc2d 100644 --- a/libiberty/cp-demangle.c +++ b/libiberty/cp-demangle.c @@ -4777,7 +4777,7 @@ d_demangle (const char *mangled, int options, size_t *palc) return NULL; } - *palc = dgs.allocation_failure ? 1 : 0; + *palc = dgs.allocation_failure ? 1 : dgs.alc; return dgs.buf; } diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index a8276a32413..e0fe5698976 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,10 +1,15 @@ +2010-01-09 H.J. Lu + + PR other/42230 + * testsuite/abi/pr42230.cc: New. + 2010-01-09 Paolo Carlini * include/debug/set.h: Revert last change, per DR 1204 [Ready]; mention the latter in comment. * include/debug/unordered_map: Likewise. - * include/debug/multiset.h: Likewise. - * include/debug/vector: Likewise. + * include/debug/multiset.h: Likewise. + * include/debug/vector: Likewise. * include/debug/unordered_set: Likewise. * include/debug/deque: Likewise. * include/debug/map.h: Likewise. diff --git a/libstdc++-v3/testsuite/abi/pr42230.cc b/libstdc++-v3/testsuite/abi/pr42230.cc new file mode 100644 index 00000000000..2a338995336 --- /dev/null +++ b/libstdc++-v3/testsuite/abi/pr42230.cc @@ -0,0 +1,16 @@ +// { dg-do run } + +#include +#include +#include + +int main() +{ + std::size_t length = 0; + int cc; + + char* ret = abi::__cxa_demangle("e", 0, &length, &cc); + + assert( (cc < 0 && !ret) || (ret && length) ); + return 0; +} -- 2.11.0