From 87a832e391ccf5a24dc70ceec1e13d94df16968e Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin (Intel)" Date: Fri, 3 Jul 2020 18:44:55 -0700 Subject: BR 3392691: errors: issue ERR_PASS2 messages in preproc-only mode In preproc-only mode, we only ever execute a single pass, so we need to still issue error messages created during that pass, otherwise we don't even generate %warning or %error messages... Reported-by: Jason Hood Signed-off-by: H. Peter Anvin (Intel) --- include/nasm.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') diff --git a/include/nasm.h b/include/nasm.h index 046f5fb9..91dc9e6f 100644 --- a/include/nasm.h +++ b/include/nasm.h @@ -1284,6 +1284,7 @@ struct optimization { */ enum pass_type { PASS_INIT, /* Initialization, not doing anything yet */ + PASS_PREPROC, /* Preprocess-only mode (similar to PASS_FIRST) */ PASS_FIRST, /* The very first pass over the code */ PASS_OPT, /* Optimization pass */ PASS_STAB, /* Stabilization pass (original pass 1) */ @@ -1319,6 +1320,11 @@ static inline bool pass_final(void) { return pass_type() >= PASS_FINAL; } +/* True for code generation *or* preprocess-only mode */ +static inline bool pass_final_or_preproc(void) +{ + return pass_type() >= PASS_FINAL || pass_type() == PASS_PREPROC; +} /* * The actual pass number. 0 is used during initialization, the very -- cgit v1.2.1 From 5b7369d7e0e256684bc92ab2ec8a822d9eb32e32 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin (Intel)" Date: Sun, 5 Jul 2020 02:16:13 -0700 Subject: Make debug info and error messages correctly reflect macros and reps 1. Error messages would issue with the line number of %endrep. 2. Debug line information would ignore both macros and reps. This is doubly wrong; macros are semantically equivalent to inline functions, and it is expected that debuggers trace into these functions. These changes finishes the last parts of moving all responsibility for the listing enable/disable into the preprocessor, so remove the way over-complicated macro inhibit facility from the listing module entirely. Signed-off-by: H. Peter Anvin (Intel) --- include/nasm.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/nasm.h b/include/nasm.h index 91dc9e6f..616ffb37 100644 --- a/include/nasm.h +++ b/include/nasm.h @@ -428,7 +428,6 @@ static inline char *nasm_skip_identifier(const char *str) enum { LIST_READ, LIST_MACRO, - LIST_MACRO_NOLIST, LIST_INCLUDE, LIST_INCBIN, LIST_TIMES -- cgit v1.2.1