aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbtypes.c
diff options
context:
space:
mode:
authorBrendan Kehoe <brendan@cygnus>1995-12-06 02:34:53 +0000
committerBrendan Kehoe <brendan@cygnus>1995-12-06 02:34:53 +0000
commite045712fa8d45749a371373646842eff87240163 (patch)
tree4ee1f6d1dc163d7a414a787826b6f4ab0ba349b7 /gdb/gdbtypes.c
parent67e218392fd7a6558d1f2024066df0d258787c93 (diff)
downloadgdb-e045712fa8d45749a371373646842eff87240163.zip
gdb-e045712fa8d45749a371373646842eff87240163.tar.gz
gdb-e045712fa8d45749a371373646842eff87240163.tar.bz2
* gdbtypes.c (check_stub_method): Make sure we get back a function
string in the demangled name before we try to use it. fixes gdb/8306 (Mentor, ser/med)
Diffstat (limited to 'gdb/gdbtypes.c')
-rw-r--r--gdb/gdbtypes.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index d023eed..3cde087 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -974,14 +974,16 @@ check_stub_method (type, i, j)
struct type **argtypes;
struct type *mtype;
- if (demangled_name == NULL)
- {
- error ("Internal: Cannot demangle mangled name `%s'.", mangled_name);
- }
+ /* Make sure we got back a function string that we can use. */
+ if (demangled_name)
+ p = strchr (demangled_name, '(');
+
+ if (demangled_name == NULL || p == NULL)
+ error ("Internal: Cannot demangle mangled name `%s'.", mangled_name);
/* Now, read in the parameters that define this type. */
- argtypetext = strchr (demangled_name, '(') + 1;
- p = argtypetext;
+ p += 1;
+ argtypetext = p;
while (*p)
{
if (*p == '(')