diff options
author | Chang S. Bae <chang.seok.bae@intel.com> | 2020-04-20 21:43:44 +0000 |
---|---|---|
committer | Chang S. Bae <chang.seok.bae@intel.com> | 2020-04-21 21:41:33 +0000 |
commit | c52aff4cc8680e404cce1cc2a183b7015f07be08 (patch) | |
tree | fddbbb94bca7e594878a6f90b0ad4f8ac5dd8f1e /asm | |
parent | 5f8d0ec1f6487fb7a2520b1c81292f2242acb01c (diff) | |
download | nasm-c52aff4cc8680e404cce1cc2a183b7015f07be08.tar.gz |
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 <dalecurtis@chromium.org>
Link: https://bugzilla.nasm.us/show_bug.cgi?id=3392659
Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com>
Diffstat (limited to 'asm')
-rw-r--r-- | asm/preproc.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; |