BR3064459: Missing %endif doesn't always cause error
authorCyrill Gorcunov <gorcunov@gmail.com>
Sat, 11 Sep 2010 22:00:05 +0000 (02:00 +0400)
committerCyrill Gorcunov <gorcunov@gmail.com>
Sat, 11 Sep 2010 22:07:06 +0000 (02:07 +0400)
error() routine is conditional dependent so we should
use nasm_error instead to yield message unconditionally.

Reported-by: Christian Masloch
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
preproc.c

index 70e550d0c1f51f927dce3c90fb777c4d1ff46857..593c9326b4b996b30dd92b3ca5255f2683ee6550 100644 (file)
--- a/preproc.c
+++ b/preproc.c
@@ -4925,9 +4925,11 @@ static char *pp_getline(void)
             {
                 Include *i = istk;
                 fclose(i->fp);
-                if (i->conds)
-                    error(ERR_FATAL,
-                          "expected `%%endif' before end of file");
+                if (i->conds) {
+                    /* nasm_error can't be conditionally suppressed */
+                    nasm_error(ERR_FATAL,
+                               "expected `%%endif' before end of file");
+                }
                 /* only set line and file name if there's a next node */
                 if (i->next) {
                     src_set_linnum(i->lineno);