diff options
author | Björn Gustavsson <[email protected]> | 2016-09-26 15:01:19 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2016-10-05 13:00:45 +0200 |
commit | 0c599bcad1e7f5f66dd2342ab27791048145e892 (patch) | |
tree | 2f9702b3f3c829d6862df0cc193d5abc394251b4 /lib/compiler/src/beam_split.erl | |
parent | 3f3f25b23379b1afb15cc97462cf5d385690f5a0 (diff) | |
download | otp-0c599bcad1e7f5f66dd2342ab27791048145e892.tar.gz otp-0c599bcad1e7f5f66dd2342ab27791048145e892.tar.bz2 otp-0c599bcad1e7f5f66dd2342ab27791048145e892.zip |
beam_block: Avoid unsafe inclusion of get_map_elements in blocks
c2035ebb8b restricted the get_map_elements instruction so that it
could only occur at the beginning of a block. It turns out that
including it anywhere in a block is unsafe.
Therefore, never put get_map_elements instruction in blocks.
(Also remove the beam_utils:join_even/2 function since it is no
longer used.)
ERL-266
Diffstat (limited to 'lib/compiler/src/beam_split.erl')
-rw-r--r-- | lib/compiler/src/beam_split.erl | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/lib/compiler/src/beam_split.erl b/lib/compiler/src/beam_split.erl index c83c686953..feeab0af50 100644 --- a/lib/compiler/src/beam_split.erl +++ b/lib/compiler/src/beam_split.erl @@ -56,9 +56,6 @@ split_block([{set,[D],[S|Puts],{alloc,R,{put_map,Op,{f,Lbl}=Fail}}}|Is], Bl, Acc) when Lbl =/= 0 -> split_block(Is, [], [{put_map,Fail,Op,S,D,R,{list,Puts}}| make_block(Bl, Acc)]); -split_block([{set,Ds,[S|Ss],{get_map_elements,Fail}}|Is], Bl, Acc) -> - Gets = beam_utils:join_even(Ss,Ds), - split_block(Is, [], [{get_map_elements,Fail,S,{list,Gets}}|make_block(Bl, Acc)]); split_block([{set,[R],[],{try_catch,Op,L}}|Is], Bl, Acc) -> split_block(Is, [], [{Op,R,L}|make_block(Bl, Acc)]); split_block([{set,[],[],{line,_}=Line}|Is], Bl, Acc) -> |