aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2019-02-11 06:37:58 +0100
committerGitHub <[email protected]>2019-02-11 06:37:58 +0100
commiteac67ca98374701eb27be53836a216e8600be4aa (patch)
tree991717f63f9cfbc5a656fcb09b44e53603fd061a /lib/stdlib
parent20b76b6c535bf0279950ea9ef5d02c52a9f8b51c (diff)
parent4763811e1d67a0d2ac3442d4694b4e1dee1b4364 (diff)
downloadotp-eac67ca98374701eb27be53836a216e8600be4aa.tar.gz
otp-eac67ca98374701eb27be53836a216e8600be4aa.tar.bz2
otp-eac67ca98374701eb27be53836a216e8600be4aa.zip
Merge pull request #2134 from bjorng/bjorn/compiler/propagate-none
beam_ssa_type: Propagate the 'none' type from calls
Diffstat (limited to 'lib/stdlib')
-rw-r--r--lib/stdlib/test/erl_eval_SUITE.erl12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/stdlib/test/erl_eval_SUITE.erl b/lib/stdlib/test/erl_eval_SUITE.erl
index f4019d477b..2436c8091c 100644
--- a/lib/stdlib/test/erl_eval_SUITE.erl
+++ b/lib/stdlib/test/erl_eval_SUITE.erl
@@ -1156,7 +1156,17 @@ simple() ->
{A}.
simple1() ->
- erlang:error(simple).
+ %% If the compiler could see that this function would always
+ %% throw an error exception, it would rewrite simple() like this:
+ %%
+ %% simple() -> simple1().
+ %%
+ %% That would change the stacktrace. To prevent the compiler from
+ %% doing that optimization, we must obfuscate the code.
+ case get(a_key_that_is_not_defined) of
+ undefined -> erlang:error(simple);
+ WillNeverHappen -> WillNeverHappen
+ end.
%% Simple cases, just to cover some code.
funs(Config) when is_list(Config) ->