diff options
author | Nick Clifton <nickc@redhat.com> | 2008-03-13 10:51:33 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2008-03-13 10:51:33 +0000 |
commit | 5808f4a685c011dca2ea8046508af6c39b91b8da (patch) | |
tree | 387c784a97d6c2a1eb6ac2e81b1dac1d24699ed3 /gas/read.c | |
parent | 72de5009312d26000c098d9876e30e631b80fc95 (diff) | |
download | gdb-5808f4a685c011dca2ea8046508af6c39b91b8da.zip gdb-5808f4a685c011dca2ea8046508af6c39b91b8da.tar.gz gdb-5808f4a685c011dca2ea8046508af6c39b91b8da.tar.bz2 |
PR gas/5895
* read.c (s_mexit): Warn if attempting to exit a macro when not
inside a macro definition.
* gas/macros/exit.s: New test case.
* gas/macros/macros.exp: Run the new test, expect it to produce an
error result.
Diffstat (limited to 'gas/read.c')
-rw-r--r-- | gas/read.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -2554,8 +2554,13 @@ s_macro (int ignore ATTRIBUTE_UNUSED) void s_mexit (int ignore ATTRIBUTE_UNUSED) { - cond_exit_macro (macro_nest); - buffer_limit = input_scrub_next_buffer (&input_line_pointer); + if (macro_nest) + { + cond_exit_macro (macro_nest); + buffer_limit = input_scrub_next_buffer (&input_line_pointer); + } + else + as_warn (_("ignoring macro exit outside a macro definition.")); } /* Switch in and out of MRI mode. */ |