File 0226-beam_validator-Remove-dead-matching.patch of Package erlang
From 95e84f5f97f44e90c503c399aa4f7ae462d63c94 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?John=20H=C3=B6gberg?= <john@erlang.org>
Date: Tue, 24 Nov 2020 09:36:48 +0100
Subject: [PATCH] beam_validator: Remove dead matching
There used to be more cases that matched on `Fail`, but I forgot
to remove `Fail` together with those.
---
lib/compiler/src/beam_validator.erl | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/compiler/src/beam_validator.erl b/lib/compiler/src/beam_validator.erl
index 17a9efebc7..8be5db35a7 100644
--- a/lib/compiler/src/beam_validator.erl
+++ b/lib/compiler/src/beam_validator.erl
@@ -1318,16 +1318,16 @@ verify_return(Vst) ->
%%
validate_bif(Kind, Op, Fail, Ss, Dst, OrigVst, Vst) ->
- case {will_bif_succeed(Op, Ss, Vst), Fail} of
- {yes, _} ->
+ case will_bif_succeed(Op, Ss, Vst) of
+ yes ->
%% This BIF cannot fail (neither throw nor branch), make sure it's
%% handled without updating exception state.
validate_bif_1(Kind, Op, cannot_fail, Ss, Dst, OrigVst, Vst);
- {no, _} ->
+ no ->
%% This BIF always fails; jump directly to the fail block or
%% exception handler.
branch(Fail, Vst, fun kill_state/1);
- {maybe, _} ->
+ maybe ->
validate_bif_1(Kind, Op, Fail, Ss, Dst, OrigVst, Vst)
end.
--
2.26.2