Skip to content

Commit

Permalink
PR gas/11507
Browse files Browse the repository at this point in the history
        * macro.c (macro_expand_body): Do not treat LOCAL as a keyword in
        altmacro mode if found inside a quoted string.

        * gas/macros/altmacro.s: New test.
        * gas/macros/altmacro.d: Expected output.
  • Loading branch information
nickclifton committed Apr 20, 2010
1 parent 1c07cc1 commit aa27de9
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 1 deletion.
6 changes: 6 additions & 0 deletions gas/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2010-04-20 Nick Clifton <[email protected]>

PR gas/11507
* macro.c (macro_expand_body): Do not treat LOCAL as a keyword in
altmacro mode if found inside a quoted string.

2010-04-20 Mike Frysinger <[email protected]>

* config/bfin-lex.l (parse_int): Change index() to strchr().
Expand Down
4 changes: 3 additions & 1 deletion gas/macro.c
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,9 @@ macro_expand_body (sb *in, sb *out, formal_entry *formals,
if (! macro
|| src + 5 >= in->len
|| strncasecmp (in->ptr + src, "LOCAL", 5) != 0
|| ! ISWHITE (in->ptr[src + 5]))
|| ! ISWHITE (in->ptr[src + 5])
/* PR 11507: Skip keyword LOCAL if it is found inside a quoted string. */
|| inquote)
{
sb_reset (&t);
src = sub_actual (src, in, &t, formal_hash,
Expand Down
6 changes: 6 additions & 0 deletions gas/testsuite/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2010-04-20 Nick Clifton <[email protected]>

PR gas/11507
* gas/macros/altmacro.s: New test.
* gas/macros/altmacro.d: Expected output.

2010-04-16 Nick Clifton <[email protected]>

PR gas/11395
Expand Down
3 changes: 3 additions & 0 deletions gas/testsuite/gas/macros/altmacro.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
local
.LL0001
.LL0002
26 changes: 26 additions & 0 deletions gas/testsuite/gas/macros/altmacro.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Check use of LOCAL directive inside .altmacro.
# Test derived from PR 11507.

.altmacro

.macro ABC
.print "local "
.endm

.macro DEF
LOCAL fred
.print "fred"
.endm

# This one is just being perverse, but it should work.
.macro GHI
local local
.print "local"
.endm


ABC

DEF

GHI

0 comments on commit aa27de9

Please sign in to comment.