summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-05-29 19:08:08 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-05-29 19:08:08 -0700
commitb037a67e68a0dcab179fc5dea7b2ef900cfec9d2 (patch)
tree4c7af7add57721cf2e29cecea6bf8a3be53893ca
parent14b015f9d6f3067091b1725a6fb5b2f896ac60b3 (diff)
downloadnasm-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.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/preproc.c b/preproc.c
index fe9a67e1..482d6af2 100644
--- a/preproc.c
+++ b/preproc.c
@@ -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);
/*