Commit 93cacb72 by Kazu Hirata Committed by Kazu Hirata

h8300.c (h8300_encode_label): Compute a string before passing it to ggc_alloc_string.

	* config/h8300/h8300.c (h8300_encode_label): Compute a string
	before passing it to ggc_alloc_string.

From-SVN: r46695
parent b522a9ce
2001-11-01 Kazu Hirata <kazu@hxi.com> 2001-11-01 Kazu Hirata <kazu@hxi.com>
* config/h8300/h8300.c (h8300_encode_label): Compute a string
before passing it to ggc_alloc_string.
2001-11-01 Kazu Hirata <kazu@hxi.com>
* config/m68k/3b1.h: Fix comment formatting. * config/m68k/3b1.h: Fix comment formatting.
* config/m68k/3b1g.h: Likewise. * config/m68k/3b1g.h: Likewise.
* config/m68k/a-ux.h: Likewise. * config/m68k/a-ux.h: Likewise.
......
...@@ -3108,13 +3108,13 @@ h8300_encode_label (decl) ...@@ -3108,13 +3108,13 @@ h8300_encode_label (decl)
{ {
const char *str = XSTR (XEXP (DECL_RTL (decl), 0), 0); const char *str = XSTR (XEXP (DECL_RTL (decl), 0), 0);
int len = strlen (str); int len = strlen (str);
char *newstr; char *newstr = alloca (len + 2);
newstr = ggc_alloc_string (NULL, len + 1); newstr[0] = '&';
strcpy (&newstr[1], str);
strcpy (newstr + 1, str); XSTR (XEXP (DECL_RTL (decl), 0), 0) =
*newstr = '&'; ggc_alloc_string (newstr, len + 1);
XSTR (XEXP (DECL_RTL (decl), 0), 0) = newstr;
} }
const char * const char *
......
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