aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/test
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2019-05-27 13:22:24 +0200
committerBjörn Gustavsson <[email protected]>2019-05-27 13:22:24 +0200
commit4b972d6934a2362e228e1458b0a6b2ca5d6aa6c8 (patch)
tree7e9d15e3a4b2a0780e0d502ab4db939bba992a61 /lib/compiler/test
parentf1a366fe111bf39478e93062e69626364e91e3a1 (diff)
parentf7fe4573880ce94d794af266d0f37459b7a86709 (diff)
downloadotp-4b972d6934a2362e228e1458b0a6b2ca5d6aa6c8.tar.gz
otp-4b972d6934a2362e228e1458b0a6b2ca5d6aa6c8.tar.bz2
otp-4b972d6934a2362e228e1458b0a6b2ca5d6aa6c8.zip
Merge branch 'bjorn/compiler/fix-beam_except/ERL-954/OTP-15839' into maint
* bjorn/compiler/fix-beam_except/ERL-954/OTP-15839: Fix compiler crash in beam_except
Diffstat (limited to 'lib/compiler/test')
-rw-r--r--lib/compiler/test/beam_except_SUITE.erl20
1 files changed, 18 insertions, 2 deletions
diff --git a/lib/compiler/test/beam_except_SUITE.erl b/lib/compiler/test/beam_except_SUITE.erl
index 8e3b373d29..67947dc292 100644
--- a/lib/compiler/test/beam_except_SUITE.erl
+++ b/lib/compiler/test/beam_except_SUITE.erl
@@ -21,7 +21,8 @@
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
init_per_group/2,end_per_group/2,
- multiple_allocs/1,bs_get_tail/1,coverage/1]).
+ multiple_allocs/1,bs_get_tail/1,coverage/1,
+ binary_construction_allocation/1]).
suite() -> [{ct_hooks,[ts_install_cth]}].
@@ -32,7 +33,8 @@ groups() ->
[{p,[parallel],
[multiple_allocs,
bs_get_tail,
- coverage]}].
+ coverage,
+ binary_construction_allocation]}].
init_per_suite(Config) ->
test_lib:recompile(?MODULE),
@@ -118,6 +120,20 @@ coverage(_) ->
fake_function_clause(A) -> error(function_clause, [A,42.0]).
+
+binary_construction_allocation(_Config) ->
+ ok = do_binary_construction_allocation("PUT"),
+ ok.
+
+do_binary_construction_allocation(Req) ->
+ %% Allocation for building the error term was done by the
+ %% bs_init2 instruction. beam_except crashed because it expected
+ %% an explicit allocation instruction.
+ ok = case Req of
+ "POST" -> {error, <<"BAD METHOD ", Req/binary>>, Req};
+ _ -> ok
+ end.
+
id(I) -> I.
-file("fake.erl", 1).