PR gas/11507
authorNick Clifton <nickc@redhat.com>
Tue, 20 Apr 2010 15:54:48 +0000 (15:54 +0000)
committerNick Clifton <nickc@redhat.com>
Tue, 20 Apr 2010 15:54:48 +0000 (15:54 +0000)
        * 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.

gas/ChangeLog
gas/macro.c
gas/testsuite/ChangeLog
gas/testsuite/gas/macros/altmacro.d [new file with mode: 0644]
gas/testsuite/gas/macros/altmacro.s [new file with mode: 0644]

index 78920e674933a1bf5564e3ac305615a0febaaa9f..660daad35202e46f3425304f87c5ea5a69b3f154 100644 (file)
@@ -1,3 +1,9 @@
+2010-04-20  Nick Clifton  <nickc@redhat.com>
+
+       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  <vapier@gentoo.org>
 
        * config/bfin-lex.l (parse_int): Change index() to strchr().
index b5c1824d2f0d816443f6219d19036428cce3e345..97f341473d6c5e96314f769a255f5d125be98f7e 100644 (file)
@@ -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,
index 797a2b4f78e0132b79cd4b3501a48547e80d3f2e..f5522ad3e169ff1efdf7aa87b7797017f4f9fcdc 100644 (file)
@@ -1,3 +1,9 @@
+2010-04-20  Nick Clifton  <nickc@redhat.com>
+
+       PR gas/11507
+       * gas/macros/altmacro.s: New test.
+       * gas/macros/altmacro.d: Expected output.
+
 2010-04-16  Nick Clifton  <nickc@redhat.com>
 
        PR gas/11395
diff --git a/gas/testsuite/gas/macros/altmacro.d b/gas/testsuite/gas/macros/altmacro.d
new file mode 100644 (file)
index 0000000..49c04aa
--- /dev/null
@@ -0,0 +1,3 @@
+local
+.LL0001
+.LL0002
diff --git a/gas/testsuite/gas/macros/altmacro.s b/gas/testsuite/gas/macros/altmacro.s
new file mode 100644 (file)
index 0000000..bb3a05d
--- /dev/null
@@ -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