diff options
author | H. Peter Anvin (Intel) <hpa@zytor.com> | 2020-07-10 01:52:49 -0700 |
---|---|---|
committer | H. Peter Anvin (Intel) <hpa@zytor.com> | 2020-07-10 01:52:49 -0700 |
commit | 23abe9fe88a0d045e063627e682a540a5d06779c (patch) | |
tree | 9dbc738cc5e795b33d0ed5dee8dc4009760c6430 | |
parent | 174c8ccbad10fa021a2ad2dfe929d6850db503f2 (diff) | |
download | nasm-23abe9fe88a0d045e063627e682a540a5d06779c.tar.gz |
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@zytor.com>
-rw-r--r-- | asm/preproc.c | 8 |
1 files changed, 7 insertions, 1 deletions
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)) { |