diff options
| -rw-r--r-- | gcc/ChangeLog | 5 | ||||
| -rw-r--r-- | gcc/config/h8300/h8300.c | 10 |
2 files changed, 10 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 55f5d46..45a62d0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 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/3b1g.h: Likewise. * config/m68k/a-ux.h: Likewise. diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c index c713f52..0d5fffb 100644 --- a/gcc/config/h8300/h8300.c +++ b/gcc/config/h8300/h8300.c @@ -3108,13 +3108,13 @@ h8300_encode_label (decl) { const char *str = XSTR (XEXP (DECL_RTL (decl), 0), 0); 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); - *newstr = '&'; - XSTR (XEXP (DECL_RTL (decl), 0), 0) = newstr; + XSTR (XEXP (DECL_RTL (decl), 0), 0) = + ggc_alloc_string (newstr, len + 1); } const char * |
