aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2010-08-18 05:56:41 +0000
committerAlan Modra <amodra@gmail.com>2010-08-18 05:56:41 +0000
commitd1f52f54d5ddf44dcb214ebfddca5d6b549eb7f7 (patch)
treeb37e95c7ac406388137c7eff15598c6b1e892304
parent2f06b48590e404c068914bb30199874e5d74bd72 (diff)
downloadgdb-d1f52f54d5ddf44dcb214ebfddca5d6b549eb7f7.zip
gdb-d1f52f54d5ddf44dcb214ebfddca5d6b549eb7f7.tar.gz
gdb-d1f52f54d5ddf44dcb214ebfddca5d6b549eb7f7.tar.bz2
* macro.c (sub_actual): Add back ampersand suffix when no
substitution. (macro_expand_body): Correct comment.
-rw-r--r--gas/ChangeLog6
-rw-r--r--gas/macro.c7
2 files changed, 10 insertions, 3 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index db7bf3a..2777273 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,9 @@
+2010-08-18 Alan Modra <amodra@gmail.com>
+
+ * macro.c (sub_actual): Add back ampersand suffix when no
+ substitution.
+ (macro_expand_body): Correct comment.
+
2010-08-17 Roland McGrath <roland@redhat.com>
* config/obj-elf.c (obj_elf_parse_section_letters): Take new
diff --git a/gas/macro.c b/gas/macro.c
index 3e3ffb1..e392883 100644
--- a/gas/macro.c
+++ b/gas/macro.c
@@ -748,6 +748,8 @@ sub_actual (int start, sb *in, sb *t, struct hash_control *formal_hash,
/* Doing this permits people to use & in macro bodies. */
sb_add_char (out, '&');
sb_add_sb (out, t);
+ if (src != start && in->ptr[src - 1] == '&')
+ sb_add_char (out, '&');
}
else if (copyifnotthere)
{
@@ -788,9 +790,8 @@ macro_expand_body (sb *in, sb *out, formal_entry *formals,
}
else
{
- /* FIXME: Why do we do this? */
- /* At least in alternate mode this seems correct; without this
- one can't append a literal to a parameter. */
+ /* Permit macro parameter substition delineated with
+ an '&' prefix and optional '&' suffix. */
src = sub_actual (src + 1, in, &t, formal_hash, '&', out, 0);
}
}