diff options
author | Björn Gustavsson <[email protected]> | 2018-12-06 10:19:09 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2018-12-06 10:19:09 +0100 |
commit | 111661b9500e2d499987d1f17bd08a5170131445 (patch) | |
tree | 2cec6bb869b3f653f88f102d94d0a9e54bbce5ba /lib/compiler/test | |
parent | 5cc2687c40882beac4d3eac20e279c2cbf6d0134 (diff) | |
parent | 32d28de92aea46967b7c0c4d805b453b3a4759e8 (diff) | |
download | otp-111661b9500e2d499987d1f17bd08a5170131445.tar.gz otp-111661b9500e2d499987d1f17bd08a5170131445.tar.bz2 otp-111661b9500e2d499987d1f17bd08a5170131445.zip |
Merge branch 'maint'
* maint:
Fix unsafe optimization of stack trace building
Diffstat (limited to 'lib/compiler/test')
-rw-r--r-- | lib/compiler/test/trycatch_SUITE.erl | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/lib/compiler/test/trycatch_SUITE.erl b/lib/compiler/test/trycatch_SUITE.erl index 1b7ef4ddb0..8f9cd9ab1e 100644 --- a/lib/compiler/test/trycatch_SUITE.erl +++ b/lib/compiler/test/trycatch_SUITE.erl @@ -1189,7 +1189,8 @@ bad_raise(Expr) -> test_raise(Expr) -> test_raise_1(Expr), test_raise_2(Expr), - test_raise_3(Expr). + test_raise_3(Expr), + test_raise_4(Expr). test_raise_1(Expr) -> erase(exception), @@ -1263,5 +1264,28 @@ do_test_raise_3(Expr) -> erlang:raise(exit, {exception,C,E}, Stk) end. +test_raise_4(Expr) -> + try + do_test_raise_4(Expr) + catch + exit:{exception,C,E,Stk}:Stk -> + try + Expr() + catch + C:E:S -> + [StkTop|_] = S, + [StkTop|_] = Stk + end + end. + +do_test_raise_4(Expr) -> + try + Expr() + catch + C:E:Stk -> + %% Here the stacktrace must be built. + erlang:raise(exit, {exception,C,E,Stk}, Stk) + end. + id(I) -> I. |