aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/ops.tab
diff options
context:
space:
mode:
authorJohn Högberg <[email protected]>2018-07-12 21:55:00 +0200
committerJohn Högberg <[email protected]>2018-07-13 09:57:51 +0200
commit32d674c58ba0cfddb2d5e2e83a8bf3b9a70cce4d (patch)
tree7ce0cdd94a53b611f3e038893c0cad43490b5331 /erts/emulator/beam/ops.tab
parent1f55b15c5e3f6ff79c855963876c501e9f782406 (diff)
downloadotp-32d674c58ba0cfddb2d5e2e83a8bf3b9a70cce4d.tar.gz
otp-32d674c58ba0cfddb2d5e2e83a8bf3b9a70cce4d.tar.bz2
otp-32d674c58ba0cfddb2d5e2e83a8bf3b9a70cce4d.zip
Fix a rare crash when matching on literal maps
When matching on a literal map, the map is placed into the general scratch register first. This is fine in isolation, but when the key to be matched was in a Y register it would also be placed in the scratch register, overwriting the map and crashing the emulator.
Diffstat (limited to 'erts/emulator/beam/ops.tab')
-rw-r--r--erts/emulator/beam/ops.tab5
1 files changed, 1 insertions, 4 deletions
diff --git a/erts/emulator/beam/ops.tab b/erts/emulator/beam/ops.tab
index 88ede3bb60..c51e4ef784 100644
--- a/erts/emulator/beam/ops.tab
+++ b/erts/emulator/beam/ops.tab
@@ -1421,16 +1421,13 @@ get_map_elements Fail Src Size Rest=* | map_key_sort(Size, Rest) => \
i_get_map_elements f? s I
-i_get_map_element Fail Src=xy Key=y Dst => \
- move Key x | i_get_map_element Fail Src x Dst
-
i_get_map_element_hash Fail Src=c Key Hash Dst => \
move Src x | i_get_map_element_hash Fail x Key Hash Dst
i_get_map_element_hash f? xy c I xy
i_get_map_element Fail Src=c Key Dst => \
move Src x | i_get_map_element Fail x Key Dst
-i_get_map_element f? xy x xy
+i_get_map_element f? xy xy xy
#
# Convert the plus operations to a generic plus instruction.