aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/utils.c
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2018-04-19 11:24:38 +0200
committerBjörn Gustavsson <[email protected]>2018-04-19 12:49:51 +0200
commitb5d657f176a440176eb073f749baadb7c45e19e4 (patch)
treef93e2edd9a0ee0b473c30064d51cffcf12e05875 /erts/emulator/beam/utils.c
parent0bcba3f1c9afc9a4164bf78641844a293768a7ec (diff)
downloadotp-b5d657f176a440176eb073f749baadb7c45e19e4.tar.gz
otp-b5d657f176a440176eb073f749baadb7c45e19e4.tar.bz2
otp-b5d657f176a440176eb073f749baadb7c45e19e4.zip
Make stacktraces consistent when backtrace_depth is 0
It is allowed to set the backtrace depth to 0, but when an exception is catched the stacktrace will still contain one element: 1> erlang:system_flag(backtrace_depth, 0). 8 2> catch error(badarg). {'EXIT',{badarg,[{shell,apply_fun,3, [{file,"shell.erl"},{line,908}]}]}} However, when an exception is raised using `erlang:raise/3`, there will be no elements in the stacktrace: 3> catch erlang:raise(error, badarg, [{fake,name,[arg],[]}]). {'EXIT',{badarg,[]}} Since the `error_handler` module uses `erlang:raise/3` to raise an exception when an undefined function is called, there will not be any stacktrace when calling an undefined function: 4> catch undef_module:undef_name(some_argument). {'EXIT',{undef,[]}} Fix this inconsistency by changing `erlang:raise/3` so that it always includes one element in the stacktrace: 3> catch erlang:raise(error, badarg, [{fake,name,[arg],[]}]). {'EXIT',{badarg,[{fake,name,[arg],[]}]}} 4> catch undef_module:undef_name(some_argument). {'EXIT',{undef,[{undef_module,undef_name,[some_argument],[]}]}}
Diffstat (limited to 'erts/emulator/beam/utils.c')
0 files changed, 0 insertions, 0 deletions