diff options
author | Franz Sirl <Franz.Sirl-kernel@lauterbach.com> | 2000-11-19 18:49:32 +0000 |
---|---|---|
committer | Franz Sirl <sirl@gcc.gnu.org> | 2000-11-19 18:49:32 +0000 |
commit | 88c1e412e8672502644ea459413c9a90f00e0c91 (patch) | |
tree | f8cf3ebc5c8bc129ce48f0ee9153216a63611fa3 /gcc | |
parent | e868d863dea666937f1359fbd8a2a53410b9a48f (diff) | |
download | gcc-88c1e412e8672502644ea459413c9a90f00e0c91.zip gcc-88c1e412e8672502644ea459413c9a90f00e0c91.tar.gz gcc-88c1e412e8672502644ea459413c9a90f00e0c91.tar.bz2 |
rs6000.c (rs6000_encode_section_info): Fix string length calculation and allocation.
2000-11-19 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
* rs6000/rs6000.c (rs6000_encode_section_info): Fix string length
calculation and allocation.
From-SVN: r37567
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000.c | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7788cd0..18358d4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2000-11-19 Franz Sirl <Franz.Sirl-kernel@lauterbach.com> + + * rs6000/rs6000.c (rs6000_encode_section_info): Fix string length + calculation and allocation. + 2000-11-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> * builtins.c (c_getstr): Constify variable. diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 6dbcb25..30a99bb 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -7621,11 +7621,11 @@ rs6000_encode_section_info (decl) { rtx sym_ref = XEXP (DECL_RTL (decl), 0); size_t len = strlen (XSTR (sym_ref, 0)); - char *str = alloca (len + 1); + char *str = alloca (len + 2); str[0] = '@'; memcpy (str + 1, XSTR (sym_ref, 0), len + 1); - XSTR (sym_ref, 0) = ggc_alloc_string (str, len); + XSTR (sym_ref, 0) = ggc_alloc_string (str, len + 1); } } } |