summaryrefslogtreecommitdiff
path: root/nasm.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2010-04-07 16:54:56 -0700
committerH. Peter Anvin <hpa@linux.intel.com>2010-04-07 16:54:56 -0700
commita36a4f2f1d24648912553751fae5fb2c7f78f6c8 (patch)
tree32868cfd09694b9398d5a6ecd3d0f703e26df00b /nasm.c
parent8adfa7244133b0de70e25d042eb72b6fce436711 (diff)
downloadnasm-a36a4f2f1d24648912553751fae5fb2c7f78f6c8.tar.gz
nasm-a36a4f2f1d24648912553751fae5fb2c7f78f6c8.tar.bz2
nasm-a36a4f2f1d24648912553751fae5fb2c7f78f6c8.zip
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 <hpa@linux.intel.com>
Diffstat (limited to 'nasm.c')
-rw-r--r--nasm.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/nasm.c b/nasm.c
index 70f8c9e..867d5ec 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) {