aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2016-10-28 10:13:33 +0200
committerBjörn Gustavsson <[email protected]>2016-10-28 10:13:33 +0200
commit97ee6664899949c5c40dfefa9d8b516ac639fb3c (patch)
treeaad449b470357cfe7a3bf236ecaac3e0f8c3ff26 /lib/compiler/src
parente402b08254ee9a78a2560e3123e1fb468fa948dc (diff)
parentf957985dc38034bf49711052ef02c14fa054667a (diff)
downloadotp-97ee6664899949c5c40dfefa9d8b516ac639fb3c.tar.gz
otp-97ee6664899949c5c40dfefa9d8b516ac639fb3c.tar.bz2
otp-97ee6664899949c5c40dfefa9d8b516ac639fb3c.zip
Merge branch 'maint'
* maint: Don't copy funs into guards
Diffstat (limited to 'lib/compiler/src')
-rw-r--r--lib/compiler/src/sys_core_fold.erl8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/compiler/src/sys_core_fold.erl b/lib/compiler/src/sys_core_fold.erl
index feb34b364f..44a6aa425d 100644
--- a/lib/compiler/src/sys_core_fold.erl
+++ b/lib/compiler/src/sys_core_fold.erl
@@ -1142,7 +1142,13 @@ clause_1(#c_clause{guard=G0,body=B0}=Cl, Ps1, Cexpr, Ctxt, Sub1) ->
%%
%% case A of NewVar when true -> ...
%%
- sub_set_var(Var, Cexpr, Sub2);
+ case cerl:is_c_fname(Cexpr) of
+ false ->
+ sub_set_var(Var, Cexpr, Sub2);
+ true ->
+ %% We must not copy funs, and especially not into guards.
+ Sub2
+ end;
_ ->
Sub2
end,