This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/43838] [4.4/4.5/4.6 Regression] Incorrect output from abi::__cxa_demangle



------- Comment #7 from paolo dot carlini at oracle dot com  2010-06-09 08:54 -------
Non pre-processed testcase. Apparently some buffer is overflowed.

#include <cxxabi.h>

namespace abcdefgxyzzzaaaaabbbbbb
{
  class Aaa { };

  namespace klmn
  {
    class Baaaaaaaaaaaaaaa { };
  }
}

namespace boost
{
  namespace tuples
  {

    class null_type;

    template<typename T1 = null_type, typename T2 = null_type,
             typename T3 = null_type, typename T4 = null_type,
             typename T5 = null_type, typename T6 = null_type,
             typename T7 = null_type, typename T8 = null_type,
             typename T9 = null_type, typename T10 = null_type>
      struct tuple { };
  }
}

int main()
{
  int status = 0;

  const char* mangled_name
    = typeid(boost::tuples::tuple<abcdefgxyzzzaaaaabbbbbb::Aaa,
             abcdefgxyzzzaaaaabbbbbb::klmn::Baaaaaaaaaaaaaaa>).name();

  __builtin_printf("Mangled name:\n%s\n\n", mangled_name);

  const char* dem_name = abi::__cxa_demangle(mangled_name, 0, 0, &status);

  if (0 == status)
    __builtin_printf("Demangled name:\n\n%s\n\n", dem_name);

  return 0;
}


-- 

paolo dot carlini at oracle dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Incorrect output from       |[4.4/4.5/4.6 Regression]
                   |abi::__cxa_demangle         |Incorrect output from
                   |                            |abi::__cxa_demangle


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43838


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]