summaryrefslogtreecommitdiff
path: root/gdb/cp-namespace.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/cp-namespace.c')
-rw-r--r--gdb/cp-namespace.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c
index 72002d6830d..016a42f5883 100644
--- a/gdb/cp-namespace.c
+++ b/gdb/cp-namespace.c
@@ -170,7 +170,7 @@ cp_lookup_bare_symbol (const struct language_defn *langdef,
':' may be in the args of a template spec. This isn't intended to be
a complete test, just cheap and documentary. */
if (strchr (name, '<') == NULL && strchr (name, '(') == NULL)
- gdb_assert (strchr (name, ':') == NULL);
+ gdb_assert (strstr (name, "::") == NULL);
sym = lookup_symbol_in_static_block (name, block, domain);
if (sym.symbol != NULL)
@@ -246,10 +246,9 @@ cp_search_static_and_baseclasses (const char *name,
struct block_symbol klass_sym;
struct type *klass_type;
- /* The test here uses <= instead of < because Fortran also uses this,
- and the module.exp testcase will pass "modmany::" for NAME here. */
- gdb_assert (prefix_len + 2 <= strlen (name));
- gdb_assert (name[prefix_len + 1] == ':');
+ /* Check for malformed input. */
+ if (prefix_len + 2 > strlen (name) || name[prefix_len + 1] != ':')
+ return null_block_symbol;
/* Find the name of the class and the name of the method, variable, etc. */