From a36a4f2f1d24648912553751fae5fb2c7f78f6c8 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Wed, 7 Apr 2010 16:54:56 -0700 Subject: [PATCH] nasm.c: smarter handling of missing directives If we get D_unknown, we definitely don't need to pass it to the backend for analysis. Signed-off-by: H. Peter Anvin --- nasm.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/nasm.c b/nasm.c index 70f8c9e4..867d5ec9 100644 --- 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) {