diff options
author | Björn Gustavsson <[email protected]> | 2018-03-21 10:11:58 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2018-03-21 10:11:58 +0100 |
commit | 5e1dd145e356718d8714138f2d892a25825461ce (patch) | |
tree | 455bbb7761959a9bfaa81db3d4d52f43470189c8 /erts/preloaded/src | |
parent | 2c5711efcdd48ab8a9b7cd9ae27c97b9c1f8c37e (diff) | |
download | otp-5e1dd145e356718d8714138f2d892a25825461ce.tar.gz otp-5e1dd145e356718d8714138f2d892a25825461ce.tar.bz2 otp-5e1dd145e356718d8714138f2d892a25825461ce.zip |
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 a51c0c4c0e..91cc4a304e 100644 --- a/erts/preloaded/src/erts_internal.erl +++ b/erts/preloaded/src/erts_internal.erl @@ -498,10 +498,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}. |