+2001-01-31 Alan Modra <alan@linuxcare.com.au>
+
+ * pa.c (hppa_encode_label): Correct size of alloca buffer
+ so we don't overrun it. Correct leading `*' case.
+ * pa.h (STRIP_NAME_ENCODING): Simplify now that we don't
+ need to handle `*@'.
+ (FUNCTION_NAME_P): Likewise.
+
2001-01-31 Richard Henderson <rth@redhat.com>
* config.gcc (alpha-osf5): Use float-i128.h.
rtx sym;
{
const char *str = XSTR (sym, 0);
- int len = strlen (str);
- char *newstr = alloca (len + 1);
+ int len = strlen (str) + 1;
+ char *newstr, *p;
+ p = newstr = alloca (len + 1);
if (str[0] == '*')
- *newstr++ = *str++;
- strcpy (newstr + 1, str);
- *newstr = '@';
-
- /* Prepending '@' increases the length of the string. That's important
- to note since we're going to allocate persistent storage for the
- new string. */
- len++;
+ {
+ str++;
+ len--;
+ }
+ *p++ = '@';
+ strcpy (p, str);
XSTR (sym,0) = ggc_alloc_string (newstr, len);
}
|| (TREE_CODE_CLASS (TREE_CODE (DECL)) == 'c' \
&& !(TREE_CODE (DECL) == STRING_CST && flag_writable_strings)))
-#define FUNCTION_NAME_P(NAME) \
-(*(NAME) == '@' || (*(NAME) == '*' && *((NAME) + 1) == '@'))
+#define FUNCTION_NAME_P(NAME) (*(NAME) == '@')
#define ENCODE_SECTION_INFO(DECL)\
do \
This is sort of inverse to ENCODE_SECTION_INFO. */
#define STRIP_NAME_ENCODING(VAR,SYMBOL_NAME) \
- (VAR) = ((SYMBOL_NAME) + ((SYMBOL_NAME)[0] == '*' ? \
- 1 + (SYMBOL_NAME)[1] == '@'\
- : (SYMBOL_NAME)[0] == '@'))
+ (VAR) = ((SYMBOL_NAME) \
+ + (*(SYMBOL_NAME) == '*' || *(SYMBOL_NAME) == '@'))
/* Specify the machine mode that this machine uses
for the index in the tablejump instruction. */