summaryrefslogtreecommitdiffstats
path: root/gas/macro.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2010-07-23 06:44:25 +0000
committerAlan Modra <amodra@gmail.com>2010-07-23 06:44:25 +0000
commitc0ba1095fd73bd3456b49bf86ef526f2bab46908 (patch)
tree5a7ba3a1165f91cdd8c5cc3757022d3ee80e3ceb /gas/macro.c
parent3895431c5c97eebcecbe3bcc7eafa6db97cd9783 (diff)
downloadppe42-binutils-c0ba1095fd73bd3456b49bf86ef526f2bab46908.tar.gz
ppe42-binutils-c0ba1095fd73bd3456b49bf86ef526f2bab46908.zip
PR gas/11834
* macro.c (macro_expand): Recover gracefully from named args that don't match params.
Diffstat (limited to 'gas/macro.c')
-rw-r--r--gas/macro.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gas/macro.c b/gas/macro.c
index 97f341473d..3e3ffb11f5 100644
--- a/gas/macro.c
+++ b/gas/macro.c
@@ -1072,9 +1072,13 @@ macro_expand (int idx, sb *in, macro_entry *m, sb *out)
/* Lookup the formal in the macro's list. */
ptr = (formal_entry *) hash_find (m->formal_hash, sb_terminate (&t));
if (!ptr)
- as_bad (_("Parameter named `%s' does not exist for macro `%s'"),
- t.ptr,
- m->name);
+ {
+ as_bad (_("Parameter named `%s' does not exist for macro `%s'"),
+ t.ptr,
+ m->name);
+ sb_reset (&t);
+ idx = get_any_string (idx + 1, in, &t);
+ }
else
{
/* Insert this value into the right place. */
OpenPOWER on IntegriCloud