diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/c-aux-info.c | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b5c4695..66792a3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2001-09-24 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * c-aux-info.c (affix_data_type): Use ATTRIBUTE_MALLOC. Avoid + leak by passing malloc'ed pointer to reconcat, not concat. + 2001-09-24 DJ Delorie <dj@redhat.com> * varasm.c (array_size_for_constructor): Handle STRING_CSTs also. diff --git a/gcc/c-aux-info.c b/gcc/c-aux-info.c index c9daa1d..67ecae6 100644 --- a/gcc/c-aux-info.c +++ b/gcc/c-aux-info.c @@ -39,7 +39,7 @@ typedef enum formals_style_enum formals_style; static const char *data_type; -static char *affix_data_type PARAMS ((const char *)); +static char *affix_data_type PARAMS ((const char *)) ATTRIBUTE_MALLOC; static const char *gen_formal_list_for_type PARAMS ((tree, formals_style)); static int deserves_ellipsis PARAMS ((tree)); static const char *gen_formal_list_for_func_def PARAMS ((tree, formals_style)); @@ -96,7 +96,8 @@ affix_data_type (param) *p = '\0'; qualifiers_then_data_type = concat (type_or_decl, data_type, NULL); *p = saved; - return concat (qualifiers_then_data_type, " ", p, NULL); + return reconcat (qualifiers_then_data_type, + qualifiers_then_data_type, " ", p, NULL); } /* Given a tree node which represents some "function type", generate the |