diff options
author | Sverker Eriksson <[email protected]> | 2013-10-16 16:28:21 +0200 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2013-11-18 20:19:51 +0100 |
commit | d5b6c6f0bd96108d788cdfb9be15059125b3d87f (patch) | |
tree | 738c1ba0806110f3f4161a2366cf06592ed2eb25 /erts/preloaded/src/erts_internal.erl | |
parent | f10ea68ce28e9b93ce614b5f829b1ca7f4cc753f (diff) | |
download | otp-d5b6c6f0bd96108d788cdfb9be15059125b3d87f.tar.gz otp-d5b6c6f0bd96108d788cdfb9be15059125b3d87f.tar.bz2 otp-d5b6c6f0bd96108d788cdfb9be15059125b3d87f.zip |
erts: Add erlang wrappers to binary_to_term
to not expose the trapping BIF in the stacktrace
when it throws badarg.
Diffstat (limited to 'erts/preloaded/src/erts_internal.erl')
-rw-r--r-- | erts/preloaded/src/erts_internal.erl | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/erts/preloaded/src/erts_internal.erl b/erts/preloaded/src/erts_internal.erl index c8e8e7e069..d6a185482e 100644 --- a/erts/preloaded/src/erts_internal.erl +++ b/erts/preloaded/src/erts_internal.erl @@ -29,7 +29,7 @@ -module(erts_internal). -export([await_port_send_result/3]). - +-export([binary_to_term/1, binary_to_term/2]). -export([port_command/3, port_connect/2, port_close/1, port_control/3, port_call/3, port_info/1, port_info/2]). @@ -160,3 +160,13 @@ request_system_task(_Pid, _Prio, _Request) -> check_process_code(_Module, _OptionList) -> erlang:nif_error(undefined). +-spec binary_to_term(Binary) -> term() when + Binary :: binary(). +binary_to_term(_Binary) -> + erlang:nif_error(undefined). + +-spec binary_to_term(Binary, Opts) -> term() when + Binary :: binary(), + Opts :: [safe]. +binary_to_term(_Binary, _Opts) -> + erlang:nif_error(undefined). |