aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2016-09-07 14:21:40 +0200
committerBjörn Gustavsson <[email protected]>2016-09-07 14:21:40 +0200
commitb834a527c2f420a80806fbf36d4585c1e530061c (patch)
tree366bd6415d14fedba35acc2857b63500f63f3657 /lib/compiler/src
parent04e8e3716a02c262e2569c94c4dba67d1782a1e9 (diff)
parentf9d516285dfec7db4333e919ca71e7eb0e6a41ed (diff)
downloadotp-b834a527c2f420a80806fbf36d4585c1e530061c.tar.gz
otp-b834a527c2f420a80806fbf36d4585c1e530061c.tar.bz2
otp-b834a527c2f420a80806fbf36d4585c1e530061c.zip
Merge branch 'bjorn/compiler/lc-internal-failure/OTP-13863' into maint
* bjorn/compiler/lc-internal-failure/OTP-13863: sys_core_fold: Don't move a fun into a guard
Diffstat (limited to 'lib/compiler/src')
-rw-r--r--lib/compiler/src/sys_core_fold.erl3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/compiler/src/sys_core_fold.erl b/lib/compiler/src/sys_core_fold.erl
index e0de50f3ae..08b02101a6 100644
--- a/lib/compiler/src/sys_core_fold.erl
+++ b/lib/compiler/src/sys_core_fold.erl
@@ -468,7 +468,8 @@ bitstr(#c_bitstr{val=Val,size=Size}=BinSeg, Sub) ->
%% Currently, we don't attempt to check binaries because they
%% are difficult to check.
-is_safe_simple(#c_var{}, _) -> true;
+is_safe_simple(#c_var{}=Var, _) ->
+ not cerl:is_c_fname(Var);
is_safe_simple(#c_cons{hd=H,tl=T}, Sub) ->
is_safe_simple(H, Sub) andalso is_safe_simple(T, Sub);
is_safe_simple(#c_tuple{es=Es}, Sub) -> is_safe_simple_list(Es, Sub);