aboutsummaryrefslogtreecommitdiff
path: root/gdb/cp-support.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2012-01-10 19:29:12 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2012-01-10 19:29:12 +0000
commit9934703b912c81702a1a74dd0337d5e3fd291a0f (patch)
treeeb18ec390f67e52f1987fa36a1691594af2966be /gdb/cp-support.c
parentfbfd63c0a6ed1f8192020ab09b1edc4496aff91a (diff)
downloadgdb-9934703b912c81702a1a74dd0337d5e3fd291a0f.zip
gdb-9934703b912c81702a1a74dd0337d5e3fd291a0f.tar.gz
gdb-9934703b912c81702a1a74dd0337d5e3fd291a0f.tar.bz2
gdb/
Fix regression after libiberty/ update for GCC PR 6057 and others. * c-exp.y (operator) <OPERATOR DELETE> (operator) <OPERATOR DELETE '[' ']'>: Add trailing space. * cp-name-parser.y (fill_comp, make_operator, make_dtor) (make_builtin_type, make_name): New variable i, add gdb_assert. (operator) <OPERATOR NEW>: Update ARGS to 3. (operator) <OPERATOR DELETE>: Add trailing space. (operator) <OPERATOR NEW '[' ']'>: Update ARGS to 3. (operator) <OPERATOR DELETE '[' ']'>: Add trailing space. * cp-support.c (cp_canonicalize_string): Check NULL from cp_comp_to_string, call warning and return.
Diffstat (limited to 'gdb/cp-support.c')
-rw-r--r--gdb/cp-support.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gdb/cp-support.c b/gdb/cp-support.c
index 17f8237..4902e50 100644
--- a/gdb/cp-support.c
+++ b/gdb/cp-support.c
@@ -528,6 +528,13 @@ cp_canonicalize_string (const char *string)
ret = cp_comp_to_string (info->tree, estimated_len);
cp_demangled_name_parse_free (info);
+ if (ret == NULL)
+ {
+ warning (_("internal error: string \"%s\" failed to be canonicalized"),
+ string);
+ return NULL;
+ }
+
if (strcmp (string, ret) == 0)
{
xfree (ret);