* macro.c (sub_actual): Add back ampersand suffix when no
authorAlan Modra <amodra@gmail.com>
Wed, 18 Aug 2010 05:56:41 +0000 (05:56 +0000)
committerAlan Modra <amodra@gmail.com>
Wed, 18 Aug 2010 05:56:41 +0000 (05:56 +0000)
substitution.
(macro_expand_body): Correct comment.

gas/ChangeLog
gas/macro.c

index db7bf3a17b0ebd50396b0338de3d7e7f9c0c9352..277727304caa9ae241d9e812d7097686ac2e85f9 100644 (file)
@@ -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
index 3e3ffb11f57a087b431940bc17263abaf70bd893..e39288355cbb7fbb63997262fad81264feb060be 100644 (file)
@@ -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);
            }
        }
This page took 0.027364 seconds and 4 git commands to generate.