summaryrefslogtreecommitdiff
path: root/libiberty/cp-demangle.c
diff options
context:
space:
mode:
authormrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-16 01:47:58 +0000
committermrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-16 01:47:58 +0000
commit8370b483d36930e46d3ec5a083702386af597654 (patch)
treec3abfe3ff9a4df7e1545b739c0a7409c09cd6b2d /libiberty/cp-demangle.c
parent8f7323c5912412fdde781a7667fbf60046592218 (diff)
parent6ca03b4e86cec2ebd2b61425871730a8e0cd5df9 (diff)
downloadgcc-8370b483d36930e46d3ec5a083702386af597654.tar.gz
Merge in trunk.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/wide-int@204895 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libiberty/cp-demangle.c')
-rw-r--r--libiberty/cp-demangle.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c
index 7be98048565..cbe4d8c9f63 100644
--- a/libiberty/cp-demangle.c
+++ b/libiberty/cp-demangle.c
@@ -3968,7 +3968,7 @@ d_copy_templates (struct d_print_info *dpi)
for (src = dpi->templates; src != NULL; src = src->next)
{
struct d_print_template *dst =
- malloc (sizeof (struct d_print_template));
+ (struct d_print_template *) malloc (sizeof (struct d_print_template));
if (dst == NULL)
{
@@ -4381,14 +4381,16 @@ d_print_comp (struct d_print_info *dpi, int options,
if (scope == NULL)
{
+ size_t size;
+
/* This is the first time SUB has been traversed.
We need to capture the current templates so
they can be restored if SUB is reentered as a
substitution. */
++dpi->num_saved_scopes;
- scopes = realloc (dpi->saved_scopes,
- sizeof (struct d_saved_scope)
- * dpi->num_saved_scopes);
+ size = sizeof (struct d_saved_scope) * dpi->num_saved_scopes;
+ scopes = (struct d_saved_scope *) realloc (dpi->saved_scopes,
+ size);
if (scopes == NULL)
{
d_print_error (dpi);