diff options
author | Björn Gustavsson <[email protected]> | 2018-12-05 12:36:47 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2018-12-05 12:49:45 +0100 |
commit | 235bf91dc47888e16224e4a25e636cc741173d7f (patch) | |
tree | 09e482e4950f922ce32b452f0870643d8fe9059b /lib/compiler/test/beam_ssa_SUITE.erl | |
parent | 09b620eae7ebb623d7e62cbcab28c06e65d90008 (diff) | |
download | otp-235bf91dc47888e16224e4a25e636cc741173d7f.tar.gz otp-235bf91dc47888e16224e4a25e636cc741173d7f.tar.bz2 otp-235bf91dc47888e16224e4a25e636cc741173d7f.zip |
beam_ssa_pre_codegen: Fix an internal consistency failure
The following function:
is_two_tuple(Arg) ->
case is_tuple(Arg) of
false -> false;
true -> tuple_size(Arg) == 2
end.
would cause an internal consistency failure:
Internal consistency check failed - please report this bug.
Instruction: {bif,tuple_size,{f,0},[{x,0}],{z,0}}
Error: {invalid_store,{z,0},{integer,[]}}:
Diffstat (limited to 'lib/compiler/test/beam_ssa_SUITE.erl')
-rw-r--r-- | lib/compiler/test/beam_ssa_SUITE.erl | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/compiler/test/beam_ssa_SUITE.erl b/lib/compiler/test/beam_ssa_SUITE.erl index e32e3eebfc..15cf9bcbf3 100644 --- a/lib/compiler/test/beam_ssa_SUITE.erl +++ b/lib/compiler/test/beam_ssa_SUITE.erl @@ -92,7 +92,13 @@ start_it([_|_]=MFA) -> end. tuple_matching(_Config) -> - do_tuple_matching({tag,42}). + do_tuple_matching({tag,42}), + + true = is_two_tuple({a,b}), + false = is_two_tuple({a,b,c}), + false = is_two_tuple(atom), + + ok. do_tuple_matching(Arg) -> Res = do_tuple_matching_1(Arg), @@ -118,6 +124,12 @@ do_tuple_matching_3(Tuple) when is_tuple(Tuple) -> {ok,element(2, Tuple)} end. +is_two_tuple(Arg) -> + case is_tuple(Arg) of + false -> false; + true -> tuple_size(Arg) == 2 + end. + -record(reporter_state, {res,run_config}). -record(run_config, {report_interval=0}). |