From b037a67e68a0dcab179fc5dea7b2ef900cfec9d2 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Thu, 29 May 2008 19:08:08 -0700 Subject: [PATCH] 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. --- preproc.c | 9 ++++----- 1 file 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); /* -- 2.11.4.GIT