[Nasm-bugs] [Bug 3392626] %rep listing line numbering should reset after every iteration

noreply-nasm at dev.nasm.us noreply-nasm at dev.nasm.us
Fri Feb 7 16:01:04 PST 2020


https://bugzilla.nasm.us/show_bug.cgi?id=3392626

--- Comment #2 from Chang S. Bae <chang.seok.bae at intel.com> ---
(In reply to Chang S. Bae from comment #1)

> For the record, found this commit for causing this regression:
> 
> commit ab6f8319552f17d269a5bf2facea48ea1c338b71 ab6f8319
> Author: H. Peter Anvin <hpa at zytor.com>
> Date:   Fri Aug 9 22:31:45 2019 -0700
> 
>     listing: when listing lines in macros and rep blocks, show the actual
> line
>     
>     When printing lines coming from %rep blocks and macros, show the line
>     number corresponding to the line actually being printed.
>     
>     Signed-off-by: H. Peter Anvin <hpa at zytor.com>

This commit seems to be missing to reset the original line number in each
iteration for processing %rep. A quick fix like this seems to be working:

diff --git a/asm/preproc.c b/asm/preproc.c
index 63e5f649..583925d4 100644
--- a/asm/preproc.c
+++ b/asm/preproc.c
@@ -6179,6 +6179,7 @@ static Token *pp_tokline(void)
                    Token *t, *tt, **tail;
                     Line *ll;

+                    istk->mstk.mstk->lineno = 0;
                     nasm_new(ll);
                     ll->next = istk->expansion;
                     tail = &ll->first;

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are watching all bug changes.


More information about the Nasm-bugs mailing list