File 0892-Correct-showing-of-errors-from-option-ssalint.patch of Package erlang
From a95a0aa3d801562634c5511ada319e3dae7e9f4b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= <bjorn@erlang.org>
Date: Thu, 2 Nov 2023 12:26:45 +0100
Subject: [PATCH 2/3] Correct showing of errors from option +ssalint
746fb27c38c broke the showing of errors detected when `ssalint` was
given.
---
lib/compiler/src/beam_ssa_lint.erl | 2 +-
lib/compiler/src/compile.erl | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/lib/compiler/src/beam_ssa_lint.erl b/lib/compiler/src/beam_ssa_lint.erl
index 6b6bf87bf6..7f50c42d2f 100644
--- a/lib/compiler/src/beam_ssa_lint.erl
+++ b/lib/compiler/src/beam_ssa_lint.erl
@@ -31,7 +31,7 @@
{'ok',#b_module{}} | {'error',list()}.
module(#b_module{body=Fs,name=Name}=Mod0, _Options) ->
Es0 = append([validate_function(F) || F <- Fs]),
- case [{?MODULE,E} || E <- Es0] of
+ case [{none,?MODULE,E} || E <- Es0] of
[] ->
{ok, Mod0};
[_|_]=Es ->
diff --git a/lib/compiler/src/compile.erl b/lib/compiler/src/compile.erl
index 587f5201e4..33c47d68a7 100644
--- a/lib/compiler/src/compile.erl
+++ b/lib/compiler/src/compile.erl
@@ -696,6 +696,8 @@ select_passes([{pass,Mod}|Ps], Opts) ->
{ok,Code,St};
{ok,Code,Ws} ->
{ok,Code,St#compile{warnings=St#compile.warnings++Ws}};
+ {error,Es} ->
+ {error,St#compile{errors=St#compile.errors ++ Es}};
Other ->
Es = [{St#compile.ifile,[{none,?MODULE,{bad_return,Mod,Other}}]}],
{error,St#compile{errors=St#compile.errors ++ Es}}
--
2.35.3