diff options
author | Björn Gustavsson <[email protected]> | 2019-02-11 06:37:58 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2019-02-11 06:37:58 +0100 |
commit | eac67ca98374701eb27be53836a216e8600be4aa (patch) | |
tree | 991717f63f9cfbc5a656fcb09b44e53603fd061a /lib/stdlib | |
parent | 20b76b6c535bf0279950ea9ef5d02c52a9f8b51c (diff) | |
parent | 4763811e1d67a0d2ac3442d4694b4e1dee1b4364 (diff) | |
download | otp-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.erl | 12 |
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) -> |