From: nasm-bot f. C. S. B. <cha...@in...> - 2020-05-05 06:57:43
|
Commit-ID: c52aff4cc8680e404cce1cc2a183b7015f07be08 Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=c52aff4cc8680e404cce1cc2a183b7015f07be08 Author: Chang S. Bae <cha...@in...> AuthorDate: Mon, 20 Apr 2020 21:43:44 +0000 Committer: Chang S. Bae <cha...@in...> CommitDate: Tue, 21 Apr 2020 21:41:33 +0000 preproc: Fix in accessing the definition structure of a single-line macro Determining whether we should warn on defining a single-line macro, with a name and a certain number of parameters, call a helper function, smacro_defined(). It does not always return the address of the definition structure. Fix the code to be cautiously accessing the definition structure. Fixes: e91f5cc1322e ("preproc: fix %undef of macro aliases, and add %ifdefalias") Reported-by: Dale Curtis <dal...@ch...> Link: https://bugzilla.nasm.us/show_bug.cgi?id=3392659 Signed-off-by: Chang S. Bae <cha...@in...> --- asm/preproc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asm/preproc.c b/asm/preproc.c index fae3b868..9ab05765 100644 --- a/asm/preproc.c +++ b/asm/preproc.c @@ -2448,7 +2448,7 @@ static enum cond_state if_condition(Token * tline, enum preproc_token ct) mname = tok_text(tline); ctx = get_ctx(mname, &mname); - if (smacro_defined(ctx, mname, 0, &smac, true, alias) + if (smacro_defined(ctx, mname, 0, &smac, true, alias) && smac && smac->alias == alias) { j = true; break; |