[nasm:nasm-2.15.xx] preproc: correctly handle %00 capturing a label
nasm-bot for H. Peter Anvin (Intel)
hpa at zytor.com
Fri Jul 10 01:57:03 PDT 2020
Commit-ID: 23abe9fe88a0d045e063627e682a540a5d06779c
Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=23abe9fe88a0d045e063627e682a540a5d06779c
Author: H. Peter Anvin (Intel) <hpa at zytor.com>
AuthorDate: Fri, 10 Jul 2020 01:52:49 -0700
Committer: H. Peter Anvin (Intel) <hpa at zytor.com>
CommitDate: Fri, 10 Jul 2020 01:52:49 -0700
preproc: correctly handle %00 capturing a label
defining->dstk.mmac should point back to "defining" when the topmost
definition block is a %macro block.
Otherwise %00 will not inhibit label emission.
Signed-off-by: H. Peter Anvin (Intel) <hpa at zytor.com>
---
asm/preproc.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/asm/preproc.c b/asm/preproc.c
index 81c72042..4fcdb359 100644
--- a/asm/preproc.c
+++ b/asm/preproc.c
@@ -4035,7 +4035,13 @@ issue_error:
nasm_assert(!defining);
nasm_new(def);
def->casesense = casesense;
- def->dstk.mmac = defining;
+ /*
+ * dstk.mstk points to the previous definition bracket,
+ * whereas dstk.mmac points to the topmost mmacro, which
+ * in this case is the one we are just starting to create.
+ */
+ def->dstk.mstk = defining;
+ def->dstk.mmac = def;
if (op == PP_RMACRO)
def->max_depth = nasm_limit[LIMIT_MACRO_LEVELS];
if (!parse_mmacro_spec(tline, def, dname)) {
More information about the Nasm-commits
mailing list