Commit 88c1e412 by Franz Sirl Committed by Franz Sirl

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
parent e868d863
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.
......
......@@ -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);
}
}
}
......
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