File 0321-compiler-Refine-too-strict-assert-in-beam_ssa_pp-for.patch of Package erlang

From 2ed6e0d7100e67f6d85636704ff3374aff0a9f42 Mon Sep 17 00:00:00 2001
From: Frej Drejhammar <frej.drejhammar@gmail.com>
Date: Wed, 31 May 2023 12:06:16 +0200
Subject: [PATCH] compiler: Refine too strict assert in
 beam_ssa_pp:format_tuple_set_1/1

The assertion in `beam_ssa_pp:format_tuple_set_1/1` is not always
true, as the type stored in the `Elems` map doesn't need to be exactly
the same type as `Key`, they just have to be compatible.

The assert can be triggered by running `./scripts/diffable --asm --co
'dssaopt' $TMPDIR`.
---
 lib/compiler/src/beam_ssa_pp.erl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/compiler/src/beam_ssa_pp.erl b/lib/compiler/src/beam_ssa_pp.erl
index e7bc2a97c0..b4cac8da01 100644
--- a/lib/compiler/src/beam_ssa_pp.erl
+++ b/lib/compiler/src/beam_ssa_pp.erl
@@ -427,5 +427,5 @@ format_tuple_set(RecordSet) ->
                 " | ").
 
 format_tuple_set_1({{Arity,Key},#t_tuple{size=Arity,elements=Elems}=Tuple}) ->
-    Key = map_get(1, Elems), % Assertion
+    false = none =:= beam_types:meet(Key, map_get(1, Elems)), % Assertion
     format_type(Tuple).
-- 
2.35.3

openSUSE Build Service is sponsored by