diff options
author | Björn Gustavsson <[email protected]> | 2016-09-07 14:24:38 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2016-09-07 14:24:38 +0200 |
commit | c542eabc91c9a4c1e6b9e16ba565e99984de41d2 (patch) | |
tree | 804b0fc6079dd0d39a85b1c58201c6438cbed0f1 /lib/compiler | |
parent | ddc0c20c521e00932187f55d37c2948ed324a12d (diff) | |
parent | b834a527c2f420a80806fbf36d4585c1e530061c (diff) | |
download | otp-c542eabc91c9a4c1e6b9e16ba565e99984de41d2.tar.gz otp-c542eabc91c9a4c1e6b9e16ba565e99984de41d2.tar.bz2 otp-c542eabc91c9a4c1e6b9e16ba565e99984de41d2.zip |
Merge branch 'maint'
* maint:
[snmp] Correct bug when path to mib contains UTF-8 characters
[ic] Fix but when UTF-8 character in path to idl spec
sys_core_fold: Don't move a fun into a guard
Diffstat (limited to 'lib/compiler')
-rw-r--r-- | lib/compiler/src/sys_core_fold.erl | 3 | ||||
-rw-r--r-- | lib/compiler/test/core_fold_SUITE.erl | 16 |
2 files changed, 16 insertions, 3 deletions
diff --git a/lib/compiler/src/sys_core_fold.erl b/lib/compiler/src/sys_core_fold.erl index b8065176a3..caa30a5ef4 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); diff --git a/lib/compiler/test/core_fold_SUITE.erl b/lib/compiler/test/core_fold_SUITE.erl index 376d2c8e9a..ced0e39d06 100644 --- a/lib/compiler/test/core_fold_SUITE.erl +++ b/lib/compiler/test/core_fold_SUITE.erl @@ -26,7 +26,7 @@ unused_multiple_values_error/1,unused_multiple_values/1, multiple_aliases/1,redundant_boolean_clauses/1, mixed_matching_clauses/1,unnecessary_building/1, - no_no_file/1]). + no_no_file/1,configuration/1]). -export([foo/0,foo/1,foo/2,foo/3]). @@ -45,7 +45,7 @@ groups() -> unused_multiple_values_error,unused_multiple_values, multiple_aliases,redundant_boolean_clauses, mixed_matching_clauses,unnecessary_building, - no_no_file]}]. + no_no_file,configuration]}]. init_per_suite(Config) -> @@ -499,4 +499,16 @@ experiment() -> end, ok. + +%% Make sure we don't try to move a fun into a guard. +configuration(_Config) -> + {'EXIT',_} = (catch configuration()), + ok. + +configuration() -> + [forgotten || Components <- enemy, is_tuple(fun art/0)]. + +art() -> + creating. + id(I) -> I. |