diff options
author | Kaveh R. Ghazi <ghazi@caip.rutgers.edu> | 2001-09-24 22:38:22 +0000 |
---|---|---|
committer | Kaveh Ghazi <ghazi@gcc.gnu.org> | 2001-09-24 22:38:22 +0000 |
commit | ad43d46f3abe6f4d9b41f5b1d7b46a0c320efda8 (patch) | |
tree | 7ec3b888341991cdf8a157f5d87a6dea617363e5 /gcc | |
parent | b6fc711089add2bbefb23eecea0eccb3423e9960 (diff) | |
download | gcc-ad43d46f3abe6f4d9b41f5b1d7b46a0c320efda8.zip gcc-ad43d46f3abe6f4d9b41f5b1d7b46a0c320efda8.tar.gz gcc-ad43d46f3abe6f4d9b41f5b1d7b46a0c320efda8.tar.bz2 |
libiberty.h (reconcat): New function.
include:
* libiberty.h (reconcat): New function.
libiberty:
* concat.c (reconcat): New function.
gcc:
* c-aux-info.c (affix_data_type): Use ATTRIBUTE_MALLOC. Avoid
leak by passing malloc'ed pointer to reconcat, not concat.
From-SVN: r45789
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 |