Fix from Ed Beroset for unterminated %macro directive -> coredump
authorH. Peter Anvin <hpa@zytor.com>
Tue, 14 May 2002 03:18:53 +0000 (03:18 +0000)
committerH. Peter Anvin <hpa@zytor.com>
Tue, 14 May 2002 03:18:53 +0000 (03:18 +0000)
preproc.c

index cba80e9..4fad1c1 100644 (file)
--- a/preproc.c
+++ b/preproc.c
@@ -4010,14 +4010,14 @@ error(int severity, char *fmt, ...)
     char buff[1024];
 
     /* If we're in a dead branch of IF or something like it, ignore the error */
-    if (istk->conds && !emitting(istk->conds->state))
+    if (istk && istk->conds && !emitting(istk->conds->state))
        return;
 
     va_start(arg, fmt);
     vsprintf(buff, fmt, arg);
     va_end(arg);
 
-    if (istk->mstk && istk->mstk->name)
+    if (istk && istk->mstk && istk->mstk->name)
        __error(severity | ERR_PASS1, "(%s:%d) %s", istk->mstk->name,
                istk->mstk->lineno, buff);
     else