diff options
author | John Högberg <[email protected]> | 2018-10-08 07:35:01 +0200 |
---|---|---|
committer | John Högberg <[email protected]> | 2018-10-08 07:35:01 +0200 |
commit | 3ea2ff5697d1ee53a31d7f0530692f49e9d0c516 (patch) | |
tree | b0f90aaafa4ae081412ad0412119456d172e9bcb /lib/compiler/test | |
parent | 1b4ad9a2d65a094285a40ae8507bc5b46a59b2e9 (diff) | |
parent | d6509e377db65f2afd7394db2a5154e420dfd4dc (diff) | |
download | otp-3ea2ff5697d1ee53a31d7f0530692f49e9d0c516.tar.gz otp-3ea2ff5697d1ee53a31d7f0530692f49e9d0c516.tar.bz2 otp-3ea2ff5697d1ee53a31d7f0530692f49e9d0c516.zip |
Merge branch 'john/compiler/fix-literal-fun-stackframes'
* john/compiler/fix-literal-fun-stackframes:
beam_ssa_pre_codegen: Literal funs need stack frames too
Diffstat (limited to 'lib/compiler/test')
-rw-r--r-- | lib/compiler/test/fun_SUITE.erl | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/compiler/test/fun_SUITE.erl b/lib/compiler/test/fun_SUITE.erl index e00885fcd6..1df0a05275 100644 --- a/lib/compiler/test/fun_SUITE.erl +++ b/lib/compiler/test/fun_SUITE.erl @@ -249,6 +249,13 @@ badfun(_Config) -> expect_badfun(X, catch X(put(?FUNCTION_NAME, of_course))), of_course = erase(?FUNCTION_NAME), + %% A literal as a Fun used to crash the code generator. This only happened + %% when type optimization had reduced `Fun` to a literal, hence the match. + Literal = fun(literal = Fun) -> + Fun() + end, + expect_badfun(literal, catch Literal(literal)), + ok. expect_badfun(Term, Exit) -> |