summaryrefslogtreecommitdiff
path: root/asm
diff options
context:
space:
mode:
authorChang S. Bae <chang.seok.bae@intel.com>2020-02-06 14:39:22 -0800
committerChang S. Bae <chang.seok.bae@intel.com>2020-04-21 21:11:10 +0000
commit95e54a9f1f693f38075e8c8b8553970a8cfac0d7 (patch)
tree507cb1c60185b20984a813b3823d024cadff9595 /asm
parentbb96fdc74ce894a86c3f0efaa522f5c76739a6eb (diff)
downloadnasm-95e54a9f1f693f38075e8c8b8553970a8cfac0d7.tar.gz
preproc: Fix the token iterator in expanding single-line macro
The code used to stuck in going through whitespace tokens. Fix to increment towards on the next in the loop. Reported-by: C. Masloch <pushbx@ulukai.org> Link: https://bugzilla.nasm.us/show_bug.cgi?id=3392630 Suggested-by: C. Masloch <pushbx@ulukai.org> Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com>
Diffstat (limited to 'asm')
-rw-r--r--asm/preproc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/asm/preproc.c b/asm/preproc.c
index f94d9558..befe77e8 100644
--- a/asm/preproc.c
+++ b/asm/preproc.c
@@ -5379,8 +5379,10 @@ static SMacro *expand_one_smacro(Token ***tpp)
Token *endt = tline;
tline = t;
- while (!cond_comma && t && t != endt)
+ while (!cond_comma && t && t != endt) {
cond_comma = t->type != TOK_WHITESPACE;
+ t = t->next;
+ }
}
if (tnext) {