summaryrefslogtreecommitdiff
path: root/lib/compiler/src/erl_bifs.erl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/compiler/src/erl_bifs.erl')
-rw-r--r--lib/compiler/src/erl_bifs.erl15
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/compiler/src/erl_bifs.erl b/lib/compiler/src/erl_bifs.erl
index 3a66fe1d39..567e7e8f42 100644
--- a/lib/compiler/src/erl_bifs.erl
+++ b/lib/compiler/src/erl_bifs.erl
@@ -80,10 +80,12 @@ is_pure(erlang, 'or', 2) -> true;
is_pure(erlang, 'rem', 2) -> true;
is_pure(erlang, 'xor', 2) -> true;
is_pure(erlang, abs, 1) -> true;
+is_pure(erlang, atom_to_binary, 1) -> true;
is_pure(erlang, atom_to_binary, 2) -> true;
is_pure(erlang, atom_to_list, 1) -> true;
is_pure(erlang, binary_part, 2) -> true;
is_pure(erlang, binary_part, 3) -> true;
+is_pure(erlang, binary_to_atom, 1) -> true;
is_pure(erlang, binary_to_atom, 2) -> true;
is_pure(erlang, binary_to_float, 1) -> true;
is_pure(erlang, binary_to_integer, 1) -> true;
@@ -144,6 +146,9 @@ is_pure(erlang, tuple_size, 1) -> true;
is_pure(erlang, tuple_to_list, 1) -> true;
is_pure(lists, append, 2) -> true;
is_pure(lists, subtract, 2) -> true;
+is_pure(maps, get, 2) -> true;
+is_pure(maps, is_key, 2) -> true;
+is_pure(maps, new, 0) -> true;
is_pure(math, acos, 1) -> true;
is_pure(math, acosh, 1) -> true;
is_pure(math, asin, 1) -> true;
@@ -183,8 +188,13 @@ is_pure(_, _, _) -> false.
%% and does not affect the state (although the value it returns
%% might depend on the state).
%%
-%% Note: is_function/2 and is_record/3 are NOT safe: is_function(X, foo)
-%% and is_record(X, foo, bar) will fail.
+%% NOTES
+%%
+%% is_function/2 is not safe: is_function(X, foo) will fail.
+%%
+%% is_record/3 is not safe: is_record(X, foo, bar) will fail.
+%%
+%% erlang:make_fun/3 is safe: erlang:make_fun3(foo, bar, baz) will fail.
-spec is_safe(atom(), atom(), arity()) -> boolean().
@@ -218,7 +228,6 @@ is_safe(erlang, is_port, 1) -> true;
is_safe(erlang, is_reference, 1) -> true;
is_safe(erlang, is_tuple, 1) -> true;
is_safe(erlang, make_ref, 0) -> true;
-is_safe(erlang, make_fun, 3) -> true;
is_safe(erlang, max, 2) -> true;
is_safe(erlang, min, 2) -> true;
is_safe(erlang, node, 0) -> true;