aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/ops.tab
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2015-03-20 14:45:31 +0100
committerBjörn Gustavsson <[email protected]>2015-04-13 12:37:54 +0200
commit8c5a577ed55a607841989763d78b3950eebd5b5f (patch)
tree4be8ac0cee97359f1f0a8573e4d07aae7b27fd3f /erts/emulator/beam/ops.tab
parent82b0a889fd2534af81e21c277657adf58699d73c (diff)
downloadotp-8c5a577ed55a607841989763d78b3950eebd5b5f.tar.gz
otp-8c5a577ed55a607841989763d78b3950eebd5b5f.tar.bz2
otp-8c5a577ed55a607841989763d78b3950eebd5b5f.zip
Correct transformation of put_map_assoc to new_map
A put_map_assoc instruction with an empty source map should be converted to a simpler new_map instruction. The transformation didn't happen because an empty source map is no longer represented as a NIL term (as it was in the beginning before map literals were implemented).
Diffstat (limited to 'erts/emulator/beam/ops.tab')
-rw-r--r--erts/emulator/beam/ops.tab3
1 files changed, 2 insertions, 1 deletions
diff --git a/erts/emulator/beam/ops.tab b/erts/emulator/beam/ops.tab
index ae3b7d08b8..2c4458ae74 100644
--- a/erts/emulator/beam/ops.tab
+++ b/erts/emulator/beam/ops.tab
@@ -1473,7 +1473,8 @@ apply_last I P
# Map instructions in R17.
#
-put_map_assoc F n Dst Live Size Rest=* => new_map F Dst Live Size Rest
+put_map_assoc F Map Dst Live Size Rest=* | is_empty_map(Map) => \
+ new_map F Dst Live Size Rest
put_map_assoc F Src=s Dst Live Size Rest=* => \
update_map_assoc F Src Dst Live Size Rest
put_map_assoc F Src Dst Live Size Rest=* => \