aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src
diff options
context:
space:
mode:
authorAnthony Ramine <[email protected]>2014-05-03 20:49:08 +0200
committerAnthony Ramine <[email protected]>2014-05-03 21:06:37 +0200
commitec15a2aaab58816c728676807c0b6e61d5a5185e (patch)
treeb7e26e2843ac2060696ea12635d393f91ac5dab6 /lib/stdlib/src
parentaca0b6182b039333b4c963938878d9eecc85e5a1 (diff)
downloadotp-ec15a2aaab58816c728676807c0b6e61d5a5185e.tar.gz
otp-ec15a2aaab58816c728676807c0b6e61d5a5185e.tar.bz2
otp-ec15a2aaab58816c728676807c0b6e61d5a5185e.zip
Fix evaluation of map updates in the debugger and erl_eval
Reported-by: José Valim
Diffstat (limited to 'lib/stdlib/src')
-rw-r--r--lib/stdlib/src/erl_eval.erl8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/stdlib/src/erl_eval.erl b/lib/stdlib/src/erl_eval.erl
index acde3ad5d6..3cfedfee97 100644
--- a/lib/stdlib/src/erl_eval.erl
+++ b/lib/stdlib/src/erl_eval.erl
@@ -244,17 +244,17 @@ expr({record,_,_,Name,_}, _Bs, _Lf, _Ef, _RBs) ->
erlang:raise(error, {undef_record,Name}, stacktrace());
%% map
-expr({map,_, Binding,Es}, Bs0, Lf, Ef, RBs) ->
- {value, Map0, Bs1} = expr(Binding, Bs0, Lf, Ef, RBs),
+expr({map,_,Binding,Es}, Bs0, Lf, Ef, RBs) ->
+ {value, Map0, Bs1} = expr(Binding, Bs0, Lf, Ef, none),
case Map0 of
#{} ->
- {Vs,Bs} = eval_map_fields(Es, Bs1, Lf, Ef),
+ {Vs,Bs2} = eval_map_fields(Es, Bs0, Lf, Ef),
Map1 = lists:foldl(fun ({map_assoc,K,V}, Mi) ->
maps:put(K, V, Mi);
({map_exact,K,V}, Mi) ->
maps:update(K, V, Mi)
end, Map0, Vs),
- ret_expr(Map1, Bs, RBs);
+ ret_expr(Map1, merge_bindings(Bs2, Bs1), RBs);
_ ->
erlang:raise(error, {badarg,Map0}, stacktrace())
end;