Commit b5d1497d by Jason Merrill Committed by Jason Merrill

cp-demangle.c (cplus_demangle_v3): Check that it's a v3 mangled name before…

cp-demangle.c (cplus_demangle_v3): Check that it's a v3 mangled name before allocating the dyn_string.

        * cp-demangle.c (cplus_demangle_v3): Check that it's a v3 mangled
        name before allocating the dyn_string.

From-SVN: r38043
parent f56887a7
2000-12-05 Jason Merrill <jason@redhat.com>
* cp-demangle.c (cplus_demangle_v3): Check that it's a v3 mangled
name before allocating the dyn_string.
2000-12-04 Jason Merrill <jason@redhat.com> 2000-12-04 Jason Merrill <jason@redhat.com>
* cp-demangle.c: s/new_abi/v3/. * cp-demangle.c: s/new_abi/v3/.
......
...@@ -3600,10 +3600,18 @@ char * ...@@ -3600,10 +3600,18 @@ char *
cplus_demangle_v3 (mangled) cplus_demangle_v3 (mangled)
const char* mangled; const char* mangled;
{ {
dyn_string_t demangled;
status_t status;
/* If this isn't a mangled name, don't pretend to demangle it. */
if (strncmp (mangled, "_Z", 2) != 0)
return NULL;
/* Create a dyn_string to hold the demangled name. */ /* Create a dyn_string to hold the demangled name. */
dyn_string_t demangled = dyn_string_new (0); demangled = dyn_string_new (0);
/* Attempt the demangling. */ /* Attempt the demangling. */
status_t status = cp_demangle ((char *) mangled, demangled); status = cp_demangle ((char *) mangled, demangled);
if (STATUS_NO_ERROR (status)) if (STATUS_NO_ERROR (status))
/* Demangling succeeded. */ /* Demangling succeeded. */
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment