summaryrefslogtreecommitdiff
path: root/asm/nasm.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2018-12-27 11:24:17 -0800
committerH. Peter Anvin <hpa@zytor.com>2018-12-27 11:24:17 -0800
commit4cf86ddde8cd8655819358ae88c1ff70a2a79713 (patch)
tree0fe2044908d377469021605f12b117dcfab81b19 /asm/nasm.c
parent74246c499ea4313fb8837977dc0c135fc50567c0 (diff)
downloadnasm-4cf86ddde8cd8655819358ae88c1ff70a2a79713.tar.gz
BR 3392539: some errors can "cascade". Allow suppressing if dead.
In BR 3392539, the error: helloW.s:18: error: label `rurt' changed during code generation [-w+error=label-redef-late] ... occurs a number of times after we have already issued an error. This is because the erroring instruction computes to a different size during code generation; this causes each subsequent label to cause a phase error. The phase error simply doesn't make much sense to report: if we are already committed to erroring out, it is more likely an error cascade rather than an error in its own right, so just suppress it in that case. Reported-by: <russvz@comcast.net> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'asm/nasm.c')
-rw-r--r--asm/nasm.c7
1 files changed, 6 insertions, 1 deletions
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);
}