diff options
Diffstat (limited to 'lib/compiler/test/bs_construct_SUITE.erl')
-rw-r--r-- | lib/compiler/test/bs_construct_SUITE.erl | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/compiler/test/bs_construct_SUITE.erl b/lib/compiler/test/bs_construct_SUITE.erl index 73920fbad1..bc6ed43dad 100644 --- a/lib/compiler/test/bs_construct_SUITE.erl +++ b/lib/compiler/test/bs_construct_SUITE.erl @@ -755,18 +755,25 @@ bad_binary_size2() -> bad_binary_size3(Bin) -> <<Bin:all/binary>>. -%% GH-7121: Alias analysis would not mark fun arguments as aliased, fooling -%% the beam_ssa_private_append pass. private_append(_Config) -> <<"alpha=\"alpha\",beta=\"beta\"">> = private_append_1(#{ <<"alpha">> => <<"alpha">>, <<"beta">> => <<"beta">> }), + <<>> = private_append_2(false), + {'EXIT', _} = catch private_append_2(true), + ok. +%% GH-7121: Alias analysis would not mark fun arguments as aliased, fooling +%% the beam_ssa_private_append pass. private_append_1(M) when is_map(M) -> maps:fold(fun (K, V, Acc = <<>>) -> <<Acc/binary, K/binary, "=\"", V/binary, "\"">>; (K, V, Acc) -> <<Acc/binary, ",", K/binary, "=\"", V/binary, "\"">> end, <<>>, M). + +%% GH-7142: The private append pass crashed on oddly structured code. +private_append_2(Boolean) -> + <<<<(id(Boolean) orelse <<>>)/binary>>/binary>>. |