aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler
diff options
context:
space:
mode:
authorJohn Högberg <[email protected]>2019-02-26 18:48:48 +0100
committerJohn Högberg <[email protected]>2019-02-26 18:49:40 +0100
commit53293466a3201f66954ba552a6adffb3818dc83a (patch)
treea4b6935b0a522c8219603c0e2d2697a516c4fd32 /lib/compiler
parentce60cb4e22f03219452b06db0ac7500a5fc884ea (diff)
downloadotp-53293466a3201f66954ba552a6adffb3818dc83a.tar.gz
otp-53293466a3201f66954ba552a6adffb3818dc83a.tar.bz2
otp-53293466a3201f66954ba552a6adffb3818dc83a.zip
beam_validator: Don't forget last element when using put_tuple
Diffstat (limited to 'lib/compiler')
-rw-r--r--lib/compiler/src/beam_validator.erl3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/compiler/src/beam_validator.erl b/lib/compiler/src/beam_validator.erl
index 5175be3ad5..6e68a9f1af 100644
--- a/lib/compiler/src/beam_validator.erl
+++ b/lib/compiler/src/beam_validator.erl
@@ -391,7 +391,8 @@ valfun_1({put,Src}, Vst0) ->
case St0 of
#st{puts_left=none} ->
error(not_building_a_tuple);
- #st{puts_left={1,{Dst,Sz,Es}}} ->
+ #st{puts_left={1,{Dst,Sz,Es0}}} ->
+ Es = Es0#{ {integer,Sz} => get_term_type(Src, Vst0) },
St = St0#st{puts_left=none},
create_term({tuple,Sz,Es}, put_tuple, [], Dst, Vst#vst{current=St});
#st{puts_left={PutsLeft,{Dst,Sz,Es0}}} when is_integer(PutsLeft) ->