File 0340-sys_core_inline-Kill-all-fun-annotations-when-inlini.patch of Package erlang

From 39a0f4254f759dbce35be7325e0362100baab3c5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= <bjorn@erlang.org>
Date: Thu, 17 Jan 2019 15:30:05 +0100
Subject: [PATCH] sys_core_inline: Kill *all* fun annotations when inlining

sys_core_inline didn't kill fun annotations in variables,
which could lead to duplicated wrapper functions for funs.
That was basically harmless because the duplicated functions
were eventually discarded.
---
 lib/compiler/src/sys_core_inline.erl | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/compiler/src/sys_core_inline.erl b/lib/compiler/src/sys_core_inline.erl
index 5a6cc45e4a..3380e3f1bd 100644
--- a/lib/compiler/src/sys_core_inline.erl
+++ b/lib/compiler/src/sys_core_inline.erl
@@ -195,6 +195,9 @@ kill_id_anns(Body) ->
     cerl_trees:map(fun(#c_fun{anno=A0}=CFun) ->
 			   A = kill_id_anns_1(A0),
 			   CFun#c_fun{anno=A};
+                      (#c_var{anno=A0}=Var) ->
+			   A = kill_id_anns_1(A0),
+			   Var#c_var{anno=A};
 		      (Expr) ->
 			   %% Mark everything as compiler generated to
 			   %% suppress bogus warnings.
-- 
2.16.4

openSUSE Build Service is sponsored by