diff options
author | Anthony Ramine <[email protected]> | 2014-03-01 17:40:15 +0100 |
---|---|---|
committer | Anthony Ramine <[email protected]> | 2014-03-03 01:35:10 +0100 |
commit | 1336d7879f9a722abda1fe8bc520953c5a079c79 (patch) | |
tree | 827a764d68db352f3130ad79029e7b304b2409b9 /lib/compiler/test/guard_SUITE.erl | |
parent | a74e66a68f3b4ed590f928b4fd4f0808c6287a32 (diff) | |
download | otp-1336d7879f9a722abda1fe8bc520953c5a079c79.tar.gz otp-1336d7879f9a722abda1fe8bc520953c5a079c79.tar.bz2 otp-1336d7879f9a722abda1fe8bc520953c5a079c79.zip |
Do not mark all calls to erlang:is_function/2 as safe
Calls to erlang:is_function/2 where the second is not a literal nonnegative
integer can crash at runtime and thus can't be marked as safe.
Diffstat (limited to 'lib/compiler/test/guard_SUITE.erl')
-rw-r--r-- | lib/compiler/test/guard_SUITE.erl | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/compiler/test/guard_SUITE.erl b/lib/compiler/test/guard_SUITE.erl index a0a9bb7ddd..2d9e8d1ac0 100644 --- a/lib/compiler/test/guard_SUITE.erl +++ b/lib/compiler/test/guard_SUITE.erl @@ -1023,6 +1023,10 @@ is_function_2(Config) when is_list(Config) -> true = is_function(id(fun() -> ok end), 0), false = is_function(id(fun ?MODULE:all/1), 0), false = is_function(id(fun() -> ok end), 1), + {'EXIT',{badarg,_}} = + (catch is_function(id(fun() -> ok end), -1) orelse error), + {'EXIT',{badarg,_}} = + (catch is_function(id(fun() -> ok end), '') orelse error), F = fun(_) -> ok end, if |