aboutsummaryrefslogtreecommitdiffstats
path: root/lib/hipe/cerl
diff options
context:
space:
mode:
authorHenrik Nord <[email protected]>2015-10-27 12:55:25 +0100
committerHenrik Nord <[email protected]>2015-10-27 12:55:25 +0100
commit1d6f49bfc5222217579540bd13c47a02e61896a9 (patch)
tree235b7e58fdfe6e99886c6367a5a23d7495aca0ec /lib/hipe/cerl
parent4b5853e7865d6a1baab39d7345b1b8d0280a4291 (diff)
parent7dc9eefa341fbfae0ebc55a88b96a375c611e3a4 (diff)
downloadotp-1d6f49bfc5222217579540bd13c47a02e61896a9.tar.gz
otp-1d6f49bfc5222217579540bd13c47a02e61896a9.tar.bz2
otp-1d6f49bfc5222217579540bd13c47a02e61896a9.zip
Merge branch 'maint'
Diffstat (limited to 'lib/hipe/cerl')
-rw-r--r--lib/hipe/cerl/erl_bif_types.erl14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/hipe/cerl/erl_bif_types.erl b/lib/hipe/cerl/erl_bif_types.erl
index b1f1689d9c..c92a4f2c78 100644
--- a/lib/hipe/cerl/erl_bif_types.erl
+++ b/lib/hipe/cerl/erl_bif_types.erl
@@ -768,6 +768,18 @@ type(erlang, length, 1, Xs, Opaques) ->
%% Guard bif, needs to be here.
type(erlang, map_size, 1, Xs, Opaques) ->
strict(erlang, map_size, 1, Xs, fun (_) -> t_non_neg_integer() end, Opaques);
+type(erlang, make_fun, 3, Xs, Opaques) ->
+ strict(erlang, make_fun, 3, Xs,
+ fun ([_, _, Arity]) ->
+ case t_number_vals(Arity, Opaques) of
+ [N] ->
+ case is_integer(N) andalso 0 =< N andalso N =< 255 of
+ true -> t_fun(N, t_any());
+ false -> t_none()
+ end;
+ _Other -> t_fun()
+ end
+ end, Opaques);
type(erlang, make_tuple, 2, Xs, Opaques) ->
strict(erlang, make_tuple, 2, Xs,
fun ([Int, _]) ->
@@ -2360,6 +2372,8 @@ arg_types(erlang, length, 1) ->
%% Guard bif, needs to be here.
arg_types(erlang, map_size, 1) ->
[t_map()];
+arg_types(erlang, make_fun, 3) ->
+ [t_atom(), t_atom(), t_arity()];
arg_types(erlang, make_tuple, 2) ->
[t_non_neg_fixnum(), t_any()]; % the value 0 is OK as first argument
arg_types(erlang, make_tuple, 3) ->