aboutsummaryrefslogtreecommitdiffstats
path: root/lib/hipe/test/maps_SUITE_data
diff options
context:
space:
mode:
authorMagnus Lång <[email protected]>2016-11-19 15:55:45 +0100
committerMagnus Lång <[email protected]>2016-11-19 16:13:36 +0100
commitbb4624af3e5e1a5979c547e70110a923f1c9d503 (patch)
tree023a9570cea3fbb04c30da67b97da209e049c9b9 /lib/hipe/test/maps_SUITE_data
parente7250092945c7d15063d7b2f8ab50070b2a30786 (diff)
downloadotp-bb4624af3e5e1a5979c547e70110a923f1c9d503.tar.gz
otp-bb4624af3e5e1a5979c547e70110a923f1c9d503.tar.bz2
otp-bb4624af3e5e1a5979c547e70110a923f1c9d503.zip
hipe_icode_call_elim: Fix cf elimination crash
hipe_icode_call_elim could in some cases replace an #icode_call{} with control flow with a move instruction. This would break the control flow graph invariants and cause a crash.
Diffstat (limited to 'lib/hipe/test/maps_SUITE_data')
-rw-r--r--lib/hipe/test/maps_SUITE_data/maps_redundant_branch_is_key.erl14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/hipe/test/maps_SUITE_data/maps_redundant_branch_is_key.erl b/lib/hipe/test/maps_SUITE_data/maps_redundant_branch_is_key.erl
new file mode 100644
index 0000000000..17c3acd6af
--- /dev/null
+++ b/lib/hipe/test/maps_SUITE_data/maps_redundant_branch_is_key.erl
@@ -0,0 +1,14 @@
+-module(maps_redundant_branch_is_key).
+-export([test/0]).
+
+test() ->
+ ok = thingy(#{a => 1}),
+ ok = thingy(#{a => 2}),
+ ok.
+
+thingy(Map) ->
+ try
+ #{a := _} = Map,
+ ok
+ catch _ -> error
+ end.