summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin (Intel) <hpa@zytor.com>2020-06-01 12:21:10 -0700
committerH. Peter Anvin (Intel) <hpa@zytor.com>2020-06-01 12:21:10 -0700
commit6e71496e3c8a12838b8e21b97d48746830a07c06 (patch)
treeecf545daa320f668b72e75f7a9a0620b8c308b14
parent7cfd01868cf17ea714938db093dad0845fb086f9 (diff)
downloadnasm-6e71496e3c8a12838b8e21b97d48746830a07c06.tar.gz
BR 3392669: in expand_one_smacro(), we may reach EOL before tafter
If the rest of the line is consumed, we may never see tafter, so we have to test for end of line at line 5412. We already do at 5397, so it clearly should have been there all along. Reported-by: <puppet@zju.edu.cn> Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
-rw-r--r--asm/preproc.c2
-rw-r--r--test/br3392669-57.asmbin0 -> 2790 bytes
2 files changed, 1 insertions, 1 deletions
diff --git a/asm/preproc.c b/asm/preproc.c
index 3873d9bf..e3014f3e 100644
--- a/asm/preproc.c
+++ b/asm/preproc.c
@@ -5409,7 +5409,7 @@ static SMacro *expand_one_smacro(Token ***tpp)
}
**tpp = tline;
- for (t = tline; t != tafter; t = t->next)
+ for (t = tline; t && t != tafter; t = t->next)
*tpp = &t->next;
m->in_progress = false;
diff --git a/test/br3392669-57.asm b/test/br3392669-57.asm
new file mode 100644
index 00000000..71a07cb8
--- /dev/null
+++ b/test/br3392669-57.asm
Binary files differ