summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libiberty/ChangeLog15
-rw-r--r--libiberty/cp-demangle.c10
2 files changed, 16 insertions, 9 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index cda181e10..5c0efcc20 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,9 @@
12013-11-12 Uros Bizjak <ubizjak@gmail.com>
2
3 * cp-demangle.c (d_copy_templates): Cast result of malloc
4 to (struct d_print_template *).
5 (d_print_comp): Cast result of realloc to (struct d_saved scope *).
6
12013-10-29 Marc Glisse <marc.glisse@inria.fr> 72013-10-29 Marc Glisse <marc.glisse@inria.fr>
2 8
3 PR tree-optimization/58689 9 PR tree-optimization/58689
@@ -6,7 +12,7 @@
62013-10-27 Gerald Pfeifer <gerald@pfeifer.com> 122013-10-27 Gerald Pfeifer <gerald@pfeifer.com>
7 13
8 * testsuite/test-demangle.c: Include unistd.h. 14 * testsuite/test-demangle.c: Include unistd.h.
9 15
102013-10-25 Gary Benson <gbenson@redhat.com> 162013-10-25 Gary Benson <gbenson@redhat.com>
11 17
12 * cp-demangle.c (struct d_saved_scope): New structure. 18 * cp-demangle.c (struct d_saved_scope): New structure.
@@ -18,10 +24,9 @@
18 (d_copy_templates): New function. 24 (d_copy_templates): New function.
19 (d_print_comp): New variables saved_templates and 25 (d_print_comp): New variables saved_templates and
20 need_template_restore. 26 need_template_restore.
21 [DEMANGLE_COMPONENT_REFERENCE, 27 [DEMANGLE_COMPONENT_REFERENCE, DEMANGLE_COMPONENT_RVALUE_REFERENCE]:
22 DEMANGLE_COMPONENT_RVALUE_REFERENCE]: Capture scope the first 28 Capture scope the first time the component is traversed, and use the
23 time the component is traversed, and use the captured scope for 29 captured scope for subsequent traversals.
24 subsequent traversals.
25 * testsuite/demangle-expected: Add regression test. 30 * testsuite/demangle-expected: Add regression test.
26 31
272013-10-23 Gerald Pfeifer <gerald@pfeifer.com> 322013-10-23 Gerald Pfeifer <gerald@pfeifer.com>
diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c
index 7be980485..cbe4d8c9f 100644
--- a/libiberty/cp-demangle.c
+++ b/libiberty/cp-demangle.c
@@ -3968,7 +3968,7 @@ d_copy_templates (struct d_print_info *dpi)
3968 for (src = dpi->templates; src != NULL; src = src->next) 3968 for (src = dpi->templates; src != NULL; src = src->next)
3969 { 3969 {
3970 struct d_print_template *dst = 3970 struct d_print_template *dst =
3971 malloc (sizeof (struct d_print_template)); 3971 (struct d_print_template *) malloc (sizeof (struct d_print_template));
3972 3972
3973 if (dst == NULL) 3973 if (dst == NULL)
3974 { 3974 {
@@ -4381,14 +4381,16 @@ d_print_comp (struct d_print_info *dpi, int options,
4381 4381
4382 if (scope == NULL) 4382 if (scope == NULL)
4383 { 4383 {
4384 size_t size;
4385
4384 /* This is the first time SUB has been traversed. 4386 /* This is the first time SUB has been traversed.
4385 We need to capture the current templates so 4387 We need to capture the current templates so
4386 they can be restored if SUB is reentered as a 4388 they can be restored if SUB is reentered as a
4387 substitution. */ 4389 substitution. */
4388 ++dpi->num_saved_scopes; 4390 ++dpi->num_saved_scopes;
4389 scopes = realloc (dpi->saved_scopes, 4391 size = sizeof (struct d_saved_scope) * dpi->num_saved_scopes;
4390 sizeof (struct d_saved_scope) 4392 scopes = (struct d_saved_scope *) realloc (dpi->saved_scopes,
4391 * dpi->num_saved_scopes); 4393 size);
4392 if (scopes == NULL) 4394 if (scopes == NULL)
4393 { 4395 {
4394 d_print_error (dpi); 4396 d_print_error (dpi);