From c52aff4cc8680e404cce1cc2a183b7015f07be08 Mon Sep 17 00:00:00 2001 From: "Chang S. Bae" Date: Mon, 20 Apr 2020 21:43:44 +0000 Subject: 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 Link: https://bugzilla.nasm.us/show_bug.cgi?id=3392659 Signed-off-by: Chang S. Bae --- asm/preproc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'asm') 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; -- cgit v1.2.1