File 1933-compiler-Stop-alias-analysis-when-erlang-exit-1-is-c.patch of Package erlang

From fdcca35bd5352a91502c543547b8cb35501f65eb Mon Sep 17 00:00:00 2001
From: Frej Drejhammar <frej.drejhammar@gmail.com>
Date: Thu, 6 Jul 2023 13:59:41 +0200
Subject: [PATCH 3/6] compiler: Stop alias analysis when erlang:exit/1 is
 called

erlang:exit/1 will never return, so nothing that happens after the
call can influence the aliasing status of a variable.
---
 lib/compiler/src/beam_ssa_alias.erl | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/compiler/src/beam_ssa_alias.erl b/lib/compiler/src/beam_ssa_alias.erl
index 87d3a82ae8..bbff1ca91e 100644
--- a/lib/compiler/src/beam_ssa_alias.erl
+++ b/lib/compiler/src/beam_ssa_alias.erl
@@ -1226,6 +1226,12 @@ aa_call(Dst, [#b_local{}=Callee|Args], Anno, SS0,
             %% the status of any variables
             {SS0, AAS0}
     end;
+aa_call(_Dst, [#b_remote{mod=#b_literal{val=erlang},
+                         name=#b_literal{val=exit},
+                         arity=1}|_], _Anno, SS, AAS) ->
+    %% The function will never return, so nothing that happens after
+    %% this can influence the aliasing status.
+    {SS, AAS};
 aa_call(Dst, [_Callee|Args], _Anno, SS, AAS) ->
     %% This is either a call to a fun or to an external function,
     %% assume that all arguments and the result escape.
-- 
2.35.3

openSUSE Build Service is sponsored by