diff options
author | uros <uros@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-11-12 20:02:21 +0000 |
---|---|---|
committer | uros <uros@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-11-12 20:02:21 +0000 |
commit | 6d358c8df351fd110b74faaddda7709b70e9f02a (patch) | |
tree | 143095cea06abaab179b4ccb75b68131d23c244f /libiberty | |
parent | 84c25f5d4ee9d4d03d40a1e8ab82816b36c4d4a2 (diff) | |
download | linaro-gcc-6d358c8df351fd110b74faaddda7709b70e9f02a.tar.gz linaro-gcc-6d358c8df351fd110b74faaddda7709b70e9f02a.tar.bz2 linaro-gcc-6d358c8df351fd110b74faaddda7709b70e9f02a.zip |
* 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 *).
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204713 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libiberty')
-rw-r--r-- | libiberty/ChangeLog | 15 | ||||
-rw-r--r-- | libiberty/cp-demangle.c | 10 |
2 files changed, 16 insertions, 9 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index cda181e1066..5c0efcc20d0 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,9 @@ +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> PR tree-optimization/58689 @@ -6,7 +12,7 @@ 2013-10-27 Gerald Pfeifer <gerald@pfeifer.com> * testsuite/test-demangle.c: Include unistd.h. - + 2013-10-25 Gary Benson <gbenson@redhat.com> * cp-demangle.c (struct d_saved_scope): New structure. @@ -18,10 +24,9 @@ (d_copy_templates): New function. (d_print_comp): New variables saved_templates and need_template_restore. - [DEMANGLE_COMPONENT_REFERENCE, - DEMANGLE_COMPONENT_RVALUE_REFERENCE]: Capture scope the first - time the component is traversed, and use the captured scope for - subsequent traversals. + [DEMANGLE_COMPONENT_REFERENCE, DEMANGLE_COMPONENT_RVALUE_REFERENCE]: + Capture scope the first time the component is traversed, and use the + captured scope for subsequent traversals. * testsuite/demangle-expected: Add regression test. 2013-10-23 Gerald Pfeifer <gerald@pfeifer.com> 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); |