From 6e71496e3c8a12838b8e21b97d48746830a07c06 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin (Intel)" Date: Mon, 1 Jun 2020 12:21:10 -0700 Subject: [PATCH] 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: Signed-off-by: H. Peter Anvin (Intel) --- asm/preproc.c | 2 +- test/br3392669-57.asm | Bin 0 -> 2790 bytes 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 test/br3392669-57.asm 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 0000000000000000000000000000000000000000..71a07cb8ac217f7c7c8bd17fbc49b1cc8e86debb GIT binary patch literal 2790 zcmbVOJ!lj`6rT8V>crv-Nk}0Xi#soJhP~5l5H(z35eOGVge4YQDq>hh>AgGN*a4 z_r`j^3^81M!;3rpeir6H=pS;M6ig98cCvgTQec+WFX;tdVN9@|h;2TY{3Xhb=7)ja zm(_(c6h;IgFMck-b_*eE)bqlId{!a~+B2cdA;|31ovr>}T+J=Ll{=+}i(U_7o8ctqkUHmH71HK_ zrQa79aPu(6!U+=+f`#5TSV{)VJ1Dfma4g0`1a`rK3@~WhQvK8s6XQS9qJ@pX@2idw;02*lL7!HxAOS;BMBAJBs^C8j~)_%jN?Wf$~0XyM!z zZBi(0JR7-&BDpH=YwkH{(S4n|cQ+3eMOs+Gl3cVj(8MM>^tYtt5Ic%M*nV?aEUq5c zz3%L}4ECH+N^8$yWlO}cRoMnp?q)DQd-~+Dw$WawIT%mOE-aVE+W|AZA1-P}ji3`| z-Rj7Rm&%bbD#>(S8iiED^C)7G-B7U_$ZBJQXdCJ!xA{cQO^YhS%VJB54tJ(CH~0Ol)aBNB-Aq9`x>Cu;7K(kyB^p1*5#u+J$?iadWE_KC+ns#cx9u^OmP zE9UAzAz8Xj^V(vSH2M^@_)tEDUfS9KMBQl|b{L{iDmzJSM%RKCSo+c;Pnj(jtTj2u zsn~