aboutsummaryrefslogtreecommitdiff
path: root/libiberty/cp-demint.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2017-03-13 17:49:32 +0000
committerNick Clifton <nickc@redhat.com>2017-03-13 17:49:32 +0000
commitc793cac124dd2eb34042f2e43abb099a26e34cb0 (patch)
tree775c5b6a39122ead6bcb6d7e49aede0fe635dbf8 /libiberty/cp-demint.c
parent5ef2d51bd6ae49b28282835156d1d6622beac4a6 (diff)
downloadgdb-c793cac124dd2eb34042f2e43abb099a26e34cb0.zip
gdb-c793cac124dd2eb34042f2e43abb099a26e34cb0.tar.gz
gdb-c793cac124dd2eb34042f2e43abb099a26e34cb0.tar.bz2
Sync libiberty sources with GCC.
PR demangler/70909 PR demangler/67264 * cp-demangle.c: Fix endless recursion. Pass struct demangle_component as non const. (d_make_empty): Initialize variable. (d_print_comp_inner): Limit recursion. (d_print_comp): Decrement variable. * cp-demint.c (cplus_demangle_fill_component): Initialize variable. (cplus_demangle_fill_builtin_type): Likewise. (cplus_demangle_fill_operator): Likewise. * testsuite/demangle-expected: Add tests.
Diffstat (limited to 'libiberty/cp-demint.c')
-rw-r--r--libiberty/cp-demint.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libiberty/cp-demint.c b/libiberty/cp-demint.c
index 64baffa..13a71d9 100644
--- a/libiberty/cp-demint.c
+++ b/libiberty/cp-demint.c
@@ -123,6 +123,7 @@ cplus_demangle_fill_component (struct demangle_component *p,
p->type = type;
p->u.s_binary.left = left;
p->u.s_binary.right = right;
+ p->d_printing = 0;
return 1;
}
@@ -146,6 +147,7 @@ cplus_demangle_fill_builtin_type (struct demangle_component *p,
{
p->type = DEMANGLE_COMPONENT_BUILTIN_TYPE;
p->u.s_builtin.type = &cplus_demangle_builtin_types[i];
+ p->d_printing = 0;
return 1;
}
}
@@ -172,6 +174,7 @@ cplus_demangle_fill_operator (struct demangle_component *p,
{
p->type = DEMANGLE_COMPONENT_OPERATOR;
p->u.s_operator.op = &cplus_demangle_operators[i];
+ p->d_printing = 0;
return 1;
}
}