aboutsummaryrefslogtreecommitdiff
path: root/gdb/cplus-dem.c
diff options
context:
space:
mode:
authorFred Fish <fnf@specifix.com>1992-05-11 20:32:03 +0000
committerFred Fish <fnf@specifix.com>1992-05-11 20:32:03 +0000
commit7fd31a8480e444cb9348b80bf8f4d4104c69beba (patch)
treec360b53410f6e91278cb9a2d8779a044b08add02 /gdb/cplus-dem.c
parenta7a8c21eb48b11589557200f740b38e5a3bf469c (diff)
downloadgdb-7fd31a8480e444cb9348b80bf8f4d4104c69beba.zip
gdb-7fd31a8480e444cb9348b80bf8f4d4104c69beba.tar.gz
gdb-7fd31a8480e444cb9348b80bf8f4d4104c69beba.tar.bz2
* cplus-dem.c (demangle_signature): Recognize misplaced '_' to
avoid infinite loops while demangling bogus mangled names. * valprint.c (type_print_base): Minor fix for GNU style guide conformance.
Diffstat (limited to 'gdb/cplus-dem.c')
-rw-r--r--gdb/cplus-dem.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/gdb/cplus-dem.c b/gdb/cplus-dem.c
index d4bb48e..2c4d54b 100644
--- a/gdb/cplus-dem.c
+++ b/gdb/cplus-dem.c
@@ -481,6 +481,15 @@ demangle_signature (declp, mangled, work)
success = demangle_template (declp, mangled, work);
break;
+ case '_':
+ /* At the outermost level, we cannot have a return type specified,
+ so if we run into another '_' at this point we are dealing with
+ a mangled name that is either bogus, or has been mangled by
+ some algorithm we don't know how to deal with. So just
+ reject the entire demangling. */
+ success = 0;
+ break;
+
default:
#ifdef GNU_DEMANGLING
/* Assume we have stumbled onto the first outermost function
@@ -497,7 +506,7 @@ demangle_signature (declp, mangled, work)
break;
}
#ifdef GNU_DEMANGLING
- if (expect_func)
+ if (success && expect_func)
{
func_done = 1;
success = demangle_args (declp, mangled, work);