aboutsummaryrefslogtreecommitdiff
path: root/gas/macro.c
diff options
context:
space:
mode:
authorFangrui Song <maskray@gcc.gnu.org>2024-05-15 15:05:30 -0700
committerFangrui Song <maskray@gcc.gnu.org>2024-05-15 15:05:30 -0700
commitb1d28350499d0553067e774f72e4e98c836ae92f (patch)
tree2027651dc232d5be1ba1850ca64fae3d89fb1786 /gas/macro.c
parent53071aac476c2d497b313b1ee09a462912cb1d87 (diff)
downloadgdb-b1d28350499d0553067e774f72e4e98c836ae92f.zip
gdb-b1d28350499d0553067e774f72e4e98c836ae92f.tar.gz
gdb-b1d28350499d0553067e774f72e4e98c836ae92f.tar.bz2
gas: Fix \+ expansion for .irp and .irpc
.irp and .irpc receive a null macro_entry. \+ causes a crash after the recent \+ support. Restore the previous behavior. Signed-off-by: Fangrui Song <maskray@gcc.gnu.org>
Diffstat (limited to 'gas/macro.c')
-rw-r--r--gas/macro.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gas/macro.c b/gas/macro.c
index 72d869d..3036e6a 100644
--- a/gas/macro.c
+++ b/gas/macro.c
@@ -854,7 +854,7 @@ macro_expand_body (sb *in, sb *out, formal_entry *formals,
sprintf (buffer, "%u", macro_number);
sb_add_string (out, buffer);
}
- else if (src < in->len && in->ptr[src] == '+')
+ else if (macro && src < in->len && in->ptr[src] == '+')
{
/* Sub in the current macro invocation number. */