diff options
author | Hans Bolinder <[email protected]> | 2018-02-05 12:32:07 +0100 |
---|---|---|
committer | Hans Bolinder <[email protected]> | 2018-02-06 14:40:54 +0100 |
commit | 16cb4f9c59142b4e82f1a2ccbcc904be7dfdee4c (patch) | |
tree | 0585367b4f76b4ac5f253a2378c52c0c70a5c6e1 /lib/stdlib/src/shell.erl | |
parent | 121681f93bec0f92a965059055f3492fc119548c (diff) | |
download | otp-16cb4f9c59142b4e82f1a2ccbcc904be7dfdee4c.tar.gz otp-16cb4f9c59142b4e82f1a2ccbcc904be7dfdee4c.tar.bz2 otp-16cb4f9c59142b4e82f1a2ccbcc904be7dfdee4c.zip |
stdlib: Do not call erlang:get_stacktrace()
Diffstat (limited to 'lib/stdlib/src/shell.erl')
-rw-r--r-- | lib/stdlib/src/shell.erl | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/stdlib/src/shell.erl b/lib/stdlib/src/shell.erl index ad4984b64c..e4153e7899 100644 --- a/lib/stdlib/src/shell.erl +++ b/lib/stdlib/src/shell.erl @@ -645,8 +645,7 @@ eval_exprs(Es, Shell, Bs0, RT, Lf, Ef, W) -> catch exit:normal -> exit(normal); - Class:Reason -> - Stacktrace = erlang:get_stacktrace(), + Class:Reason:Stacktrace -> M = {self(),Class,{Reason,Stacktrace}}, case do_catch(Class, Reason) of true -> @@ -807,8 +806,8 @@ restrict_handlers(RShMod, Shell, RT) -> -define(BAD_RETURN(M, F, V), try erlang:error(reason) - catch _:_ -> erlang:raise(exit, {restricted_shell_bad_return,V}, - [{M,F,3} | erlang:get_stacktrace()]) + catch _:_:S -> erlang:raise(exit, {restricted_shell_bad_return,V}, + [{M,F,3} | S]) end). local_allowed(F, As, RShMod, Bs, Shell, RT) when is_atom(F) -> |