This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: GNU AS bug?
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Almos Rajnai <racs at fs2 dot bdtf dot hu>
- Cc: bug-binutils at gnu dot org, binutils at sources dot redhat dot com
- Date: Mon, 02 Jun 2003 23:38:38 +0930
- Subject: Re: GNU AS bug?
- References: <3ED9DCFA.28598.587917@localhost>
On Sun, Jun 01, 2003 at 11:01:14AM -0700, Almos Rajnai wrote:
> 2 .set TFLAG_C, 1
> 3
> 4 .macro check
> 5
> 6 .if (0 & TFLAG_C)
> 7 .endif
> 8
> 9 .endm
> 10
> 11 .text
> 12 check
> 12 > .if (0&)
> 12 > .endif
> 13
Fixed with this patch.
* macro.c (sub_actual): Don't lose string if it turns out that
&string wasn't an arg.
I don't know whether &string should ever be treated as a macro arg,
as it appears this syntax is for macro_alternate. See the FIXME in
macro_expand_body.
Index: gas/macro.c
===================================================================
RCS file: /cvs/src/src/gas/macro.c,v
retrieving revision 1.21
diff -u -p -r1.21 macro.c
--- gas/macro.c 13 Mar 2003 11:49:33 -0000 1.21
+++ gas/macro.c 1 Jun 2003 18:39:10 -0000
@@ -637,6 +637,7 @@ sub_actual (start, in, t, formal_hash, k
{
/* Doing this permits people to use & in macro bodies. */
sb_add_char (out, '&');
+ sb_add_sb (out, t);
}
else if (copyifnotthere)
{
--
Alan Modra
IBM OzLabs - Linux Technology Centre