diff options
author | H. Peter Anvin <hpa@zytor.com> | 2008-05-29 19:08:08 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2008-05-29 19:08:08 -0700 |
commit | b037a67e68a0dcab179fc5dea7b2ef900cfec9d2 (patch) | |
tree | 4c7af7add57721cf2e29cecea6bf8a3be53893ca | |
parent | 14b015f9d6f3067091b1725a6fb5b2f896ac60b3 (diff) | |
download | nasm-b037a67e68a0dcab179fc5dea7b2ef900cfec9d2.tar.gz |
preproc.c: get_ctx() can return NULL...
Handle the case where we would attempt to look up a possible local
context just to find that one doesn't exist.
-rw-r--r-- | preproc.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -3061,14 +3061,13 @@ again: if ((mname = tline->text)) { /* if this token is a local macro, look in local context */ + ctx = NULL; + smtbl = &smacros; if (tline->type == TOK_ID || tline->type == TOK_PREPROC_ID) { ctx = get_ctx(mname, true); - smtbl = &ctx->localmac; - } else { - ctx = NULL; - smtbl = &smacros; + if (ctx) + smtbl = &ctx->localmac; } - head = (SMacro *) hash_findix(smtbl, mname); /* |