aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2014-03-07 15:10:12 +0100
committerBjörn-Egil Dahlberg <[email protected]>2014-03-07 15:10:12 +0100
commit870737ab657433c5e8751255fe3c4d298202d142 (patch)
treeb0dd23b0c900c6b3b47c364cd721ad7bfac1cf2e /lib/compiler
parent5017c6e4de41a95cd489aa0b3ddda0eb8d821623 (diff)
parent35f6804946b22ef9a813c27780d4760c157a3c3d (diff)
downloadotp-870737ab657433c5e8751255fe3c4d298202d142.tar.gz
otp-870737ab657433c5e8751255fe3c4d298202d142.tar.bz2
otp-870737ab657433c5e8751255fe3c4d298202d142.zip
Merge branch 'nox/maps-beam_jump-put_map'
* nox/maps-beam_jump-put_map: Properly collect labels in put_map instructions in beam_jump
Diffstat (limited to 'lib/compiler')
-rw-r--r--lib/compiler/src/beam_jump.erl1
-rw-r--r--lib/compiler/test/map_SUITE.erl3
2 files changed, 4 insertions, 0 deletions
diff --git a/lib/compiler/src/beam_jump.erl b/lib/compiler/src/beam_jump.erl
index 100acaede3..b952139f2c 100644
--- a/lib/compiler/src/beam_jump.erl
+++ b/lib/compiler/src/beam_jump.erl
@@ -446,6 +446,7 @@ is_label_used_in_2({set,_,_,Info}, Lbl) ->
case Info of
{bif,_,{f,F}} -> F =:= Lbl;
{alloc,_,{gc_bif,_,{f,F}}} -> F =:= Lbl;
+ {alloc,_,{put_map,_,{f,F}}} -> F =:= Lbl;
{'catch',{f,F}} -> F =:= Lbl;
{alloc,_,_} -> false;
{put_tuple,_} -> false;
diff --git a/lib/compiler/test/map_SUITE.erl b/lib/compiler/test/map_SUITE.erl
index 4fc4768802..b7e27afef1 100644
--- a/lib/compiler/test/map_SUITE.erl
+++ b/lib/compiler/test/map_SUITE.erl
@@ -292,6 +292,7 @@ get_val(#{ val := V }) -> {some_val, V}.
t_guard_bifs(Config) when is_list(Config) ->
true = map_guard_empty(),
+ true = map_guard_empty_2(),
true = map_guard_head(#{a=>1}),
false = map_guard_head([]),
true = map_guard_body(#{a=>1}),
@@ -304,6 +305,8 @@ t_guard_bifs(Config) when is_list(Config) ->
map_guard_empty() when is_map(#{}); false -> true.
+map_guard_empty_2() when true; #{} andalso false -> true.
+
map_guard_head(M) when is_map(M) -> true;
map_guard_head(_) -> false.