Commit 27297d2d by Uros Bizjak

cp-demangle.c (d_copy_templates): Cast result of malloc to (struct d_print_template *).

	* cp-demangle.c (d_copy_templates): Cast result of malloc
	to (struct d_print_template *).
	(d_print_comp): Cast result of realloc to (struct d_saved scope *).

From-SVN: r204713
parent 33fd5699
2013-11-12 Uros Bizjak <ubizjak@gmail.com>
* cp-demangle.c (d_copy_templates): Cast result of malloc
to (struct d_print_template *).
(d_print_comp): Cast result of realloc to (struct d_saved scope *).
2013-10-29 Marc Glisse <marc.glisse@inria.fr> 2013-10-29 Marc Glisse <marc.glisse@inria.fr>
PR tree-optimization/58689 PR tree-optimization/58689
...@@ -6,7 +12,7 @@ ...@@ -6,7 +12,7 @@
2013-10-27 Gerald Pfeifer <gerald@pfeifer.com> 2013-10-27 Gerald Pfeifer <gerald@pfeifer.com>
* testsuite/test-demangle.c: Include unistd.h. * testsuite/test-demangle.c: Include unistd.h.
2013-10-25 Gary Benson <gbenson@redhat.com> 2013-10-25 Gary Benson <gbenson@redhat.com>
* cp-demangle.c (struct d_saved_scope): New structure. * cp-demangle.c (struct d_saved_scope): New structure.
...@@ -18,10 +24,9 @@ ...@@ -18,10 +24,9 @@
(d_copy_templates): New function. (d_copy_templates): New function.
(d_print_comp): New variables saved_templates and (d_print_comp): New variables saved_templates and
need_template_restore. need_template_restore.
[DEMANGLE_COMPONENT_REFERENCE, [DEMANGLE_COMPONENT_REFERENCE, DEMANGLE_COMPONENT_RVALUE_REFERENCE]:
DEMANGLE_COMPONENT_RVALUE_REFERENCE]: Capture scope the first Capture scope the first time the component is traversed, and use the
time the component is traversed, and use the captured scope for captured scope for subsequent traversals.
subsequent traversals.
* testsuite/demangle-expected: Add regression test. * testsuite/demangle-expected: Add regression test.
2013-10-23 Gerald Pfeifer <gerald@pfeifer.com> 2013-10-23 Gerald Pfeifer <gerald@pfeifer.com>
......
...@@ -3968,7 +3968,7 @@ d_copy_templates (struct d_print_info *dpi) ...@@ -3968,7 +3968,7 @@ d_copy_templates (struct d_print_info *dpi)
for (src = dpi->templates; src != NULL; src = src->next) for (src = dpi->templates; src != NULL; src = src->next)
{ {
struct d_print_template *dst = struct d_print_template *dst =
malloc (sizeof (struct d_print_template)); (struct d_print_template *) malloc (sizeof (struct d_print_template));
if (dst == NULL) if (dst == NULL)
{ {
...@@ -4381,14 +4381,16 @@ d_print_comp (struct d_print_info *dpi, int options, ...@@ -4381,14 +4381,16 @@ d_print_comp (struct d_print_info *dpi, int options,
if (scope == NULL) if (scope == NULL)
{ {
size_t size;
/* This is the first time SUB has been traversed. /* This is the first time SUB has been traversed.
We need to capture the current templates so We need to capture the current templates so
they can be restored if SUB is reentered as a they can be restored if SUB is reentered as a
substitution. */ substitution. */
++dpi->num_saved_scopes; ++dpi->num_saved_scopes;
scopes = realloc (dpi->saved_scopes, size = sizeof (struct d_saved_scope) * dpi->num_saved_scopes;
sizeof (struct d_saved_scope) scopes = (struct d_saved_scope *) realloc (dpi->saved_scopes,
* dpi->num_saved_scopes); size);
if (scopes == NULL) if (scopes == NULL)
{ {
d_print_error (dpi); d_print_error (dpi);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment