aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2014-03-05 12:53:39 +0100
committerBjörn Gustavsson <[email protected]>2014-03-05 12:53:39 +0100
commita15b25bbd09b91040ba92c65c287ad04b1bc2a30 (patch)
tree3253e2230f240210feb1c060387706babb0f24b3 /lib/compiler/src
parentab044b52bbe0217bc06c9b67cba7099c28176ee9 (diff)
parent1336d7879f9a722abda1fe8bc520953c5a079c79 (diff)
downloadotp-a15b25bbd09b91040ba92c65c287ad04b1bc2a30.tar.gz
otp-a15b25bbd09b91040ba92c65c287ad04b1bc2a30.tar.bz2
otp-a15b25bbd09b91040ba92c65c287ad04b1bc2a30.zip
Merge branch 'nox/compiler/sys_core_fold-erlang-is_function-2'
* nox/compiler/sys_core_fold-erlang-is_function-2: Do not mark all calls to erlang:is_function/2 as safe
Diffstat (limited to 'lib/compiler/src')
-rw-r--r--lib/compiler/src/sys_core_fold.erl9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/compiler/src/sys_core_fold.erl b/lib/compiler/src/sys_core_fold.erl
index 4ef345f563..6fdeea51d1 100644
--- a/lib/compiler/src/sys_core_fold.erl
+++ b/lib/compiler/src/sys_core_fold.erl
@@ -2362,6 +2362,15 @@ is_safe_bool_expr_1(#c_call{module=#c_literal{val=erlang},
%% been rewritten to is_record(Expr, LiteralTag, TupleSize).
false;
is_safe_bool_expr_1(#c_call{module=#c_literal{val=erlang},
+ name=#c_literal{val=is_function},
+ args=[A,#c_literal{val=Arity}]},
+ Sub, _BoolVars) when is_integer(Arity), Arity >= 0 ->
+ is_safe_simple(A, Sub);
+is_safe_bool_expr_1(#c_call{module=#c_literal{val=erlang},
+ name=#c_literal{val=is_function}},
+ _Sub, _BoolVars) ->
+ false;
+is_safe_bool_expr_1(#c_call{module=#c_literal{val=erlang},
name=#c_literal{val=Name},args=Args},
Sub, BoolVars) ->
NumArgs = length(Args),