nasm.c: smarter handling of missing directives
authorH. Peter Anvin <hpa@linux.intel.com>
Wed, 7 Apr 2010 23:54:56 +0000 (16:54 -0700)
committerH. Peter Anvin <hpa@linux.intel.com>
Wed, 7 Apr 2010 23:54:56 +0000 (16:54 -0700)
If we get D_unknown, we definitely don't need to pass it to the
backend for analysis.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
nasm.c

diff --git a/nasm.c b/nasm.c
index 70f8c9e..867d5ec 100644 (file)
--- a/nasm.c
+++ b/nasm.c
@@ -1496,10 +1496,13 @@ static void assemble_file(char *fname, StrList **depend_ptr)
                    }
                    break;
                 default:
-                   if (!d || !ofmt->directive(d, value, pass2))
-                        nasm_error(pass1 == 1 ? ERR_NONFATAL : ERR_PANIC,
-                                     "unrecognised directive [%s]",
-                                     directive);
+                   if (ofmt->directive(d, value, pass2))
+                       break;
+                   /* else fall through */
+               case D_unknown:
+                   nasm_error(pass1 == 1 ? ERR_NONFATAL : ERR_PANIC,
+                              "unrecognised directive [%s]",
+                              directive);
                    break;
                 }
                if (err) {