diff options
author | Björn Gustavsson <[email protected]> | 2018-03-22 14:24:18 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2018-03-22 14:24:18 +0100 |
commit | 2e7ebaafe1a4e31c9ff142060987c1a5f51c8e62 (patch) | |
tree | 097d0b01c8b982d24a3246d74f2b606f329fd8dc /erts/preloaded/src | |
parent | 9773b04516f58dea50b0219fdf1eb9802d91c5d8 (diff) | |
parent | 5e1dd145e356718d8714138f2d892a25825461ce (diff) | |
download | otp-2e7ebaafe1a4e31c9ff142060987c1a5f51c8e62.tar.gz otp-2e7ebaafe1a4e31c9ff142060987c1a5f51c8e62.tar.bz2 otp-2e7ebaafe1a4e31c9ff142060987c1a5f51c8e62.zip |
Merge branch 'bjorn/erts/eliminate-get_stacktrace'
* bjorn/erts/eliminate-get_stacktrace:
Eliminate use of erlang:get_stacktrace/0 in preloaded modules
Diffstat (limited to 'erts/preloaded/src')
-rw-r--r-- | erts/preloaded/src/erts_internal.erl | 6 | ||||
-rw-r--r-- | erts/preloaded/src/prim_zip.erl | 12 |
2 files changed, 9 insertions, 9 deletions
diff --git a/erts/preloaded/src/erts_internal.erl b/erts/preloaded/src/erts_internal.erl index 21f228395e..fb709e7482 100644 --- a/erts/preloaded/src/erts_internal.erl +++ b/erts/preloaded/src/erts_internal.erl @@ -509,10 +509,10 @@ dist_ctrl_put_data(DHandle, IoList) -> %% erlang:dist_ctrl_put_data/2 ... RootST = try erlang:error(Reason) catch - error:Reason -> - case erlang:get_stacktrace() of + error:Reason:ST -> + case ST of [] -> []; - ST -> tl(ST) + [_|T] -> T end end, StackTrace = [{erlang, dist_ctrl_put_data, diff --git a/erts/preloaded/src/prim_zip.erl b/erts/preloaded/src/prim_zip.erl index b1ddbbe173..5cc15b7acd 100644 --- a/erts/preloaded/src/prim_zip.erl +++ b/erts/preloaded/src/prim_zip.erl @@ -74,8 +74,8 @@ open(FilterFun, FilterAcc, F) when is_function(FilterFun, 2) -> throw(Reason); throw:InternalReason -> {error, InternalReason}; - Class:Reason -> - erlang:error(erlang:raise(Class, Reason, erlang:get_stacktrace())) + Class:Reason:Stk -> + erlang:error(erlang:raise(Class, Reason, Stk)) end; open(_, _, _) -> {error, einval}. @@ -89,9 +89,9 @@ do_open(FilterFun, FilterAcc, F) -> {PrimZip2, FilterAcc2} = get_central_dir(PrimZip, FilterFun, FilterAcc), {ok, PrimZip2, FilterAcc2} catch - Class:Reason -> + Class:Reason:Stk -> _ = close(PrimZip), - erlang:error(erlang:raise(Class, Reason, erlang:get_stacktrace())) + erlang:error(erlang:raise(Class, Reason, Stk)) end. %% iterate over all files in a zip archive @@ -106,8 +106,8 @@ foldl(FilterFun, FilterAcc, #primzip{files = Files} = PrimZip) throw(Reason); throw:InternalReason -> {error, InternalReason}; - Class:Reason -> - erlang:error(erlang:raise(Class, Reason, erlang:get_stacktrace())) + Class:Reason:Stk -> + erlang:error(erlang:raise(Class, Reason, Stk)) end; foldl(_, _, _) -> {error, einval}. |