summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--asm/labels.c2
-rw-r--r--asm/nasm.c7
-rw-r--r--include/error.h1
3 files changed, 8 insertions, 2 deletions
diff --git a/asm/labels.c b/asm/labels.c
index 20107603..4e61fd22 100644
--- a/asm/labels.c
+++ b/asm/labels.c
@@ -529,7 +529,7 @@ void define_label(const char *label, int32_t segment,
* As a special case, LBL_SPECIAL symbols are allowed to be changed
* even during the last pass.
*/
- nasm_error(ERR_WARNING|WARN_LABEL_LATE,
+ nasm_error(ERR_WARNING|WARN_LABEL_LATE|ERR_UNDEAD,
"label `%s' %s during code generation",
lptr->defn.label, created ? "defined" : "changed");
}
diff --git a/asm/nasm.c b/asm/nasm.c
index 1c5a5fc5..1037166f 100644
--- a/asm/nasm.c
+++ b/asm/nasm.c
@@ -1775,8 +1775,13 @@ static bool skip_this_pass(int severity)
*/
static bool is_suppressed(int severity)
{
+ /* Fatal errors must never be suppressed */
if ((severity & ERR_MASK) >= ERR_FATAL)
- return false; /* Fatal errors can never be suppressed */
+ return false;
+
+ /* This error/warning is pointless if we are dead anyway */
+ if ((severity & ERR_UNDEAD) && terminate_after_phase)
+ return true;
return !(warning_state[warn_index(severity)] & WARN_ST_ENABLED);
}
diff --git a/include/error.h b/include/error.h
index 477a26d7..433c0680 100644
--- a/include/error.h
+++ b/include/error.h
@@ -76,6 +76,7 @@ static inline vefunc nasm_set_verror(vefunc ve)
#define ERR_PANIC 0x00000007 /* internal error: panic instantly
* and dump core for reference */
#define ERR_MASK 0x00000007 /* mask off the above codes */
+#define ERR_UNDEAD 0x00000008 /* skip if we already have errors */
#define ERR_NOFILE 0x00000010 /* don't give source file name/line */
#define ERR_HERE 0x00000020 /* point to a specific source location */
#define ERR_USAGE 0x00000040 /* print a usage message */