aboutsummaryrefslogtreecommitdiffstats
path: root/lib/debugger/src/dbg_ieval.erl
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2014-03-18 12:17:47 +0100
committerBjörn-Egil Dahlberg <[email protected]>2014-03-18 12:17:47 +0100
commit8d66a2823c29cbe44cf80e4de0c58f2ed5c29bd4 (patch)
tree9e15b0d71d52176905fd1c45fe1160b09be07dfd /lib/debugger/src/dbg_ieval.erl
parentfb0a5a669e43590de66d662b99c2762e596c01e3 (diff)
parent4185be0ad649bccb15bb67a15b618b6cc14fe253 (diff)
downloadotp-8d66a2823c29cbe44cf80e4de0c58f2ed5c29bd4.tar.gz
otp-8d66a2823c29cbe44cf80e4de0c58f2ed5c29bd4.tar.bz2
otp-8d66a2823c29cbe44cf80e4de0c58f2ed5c29bd4.zip
Merge branch 'nox/maps-eval-empty-update'
* nox/maps-eval-empty-update: Fix evaluation of empty map patterns in erl_lint Fix evaluation of empty map updates in the debugger Fix evaluation of empty map updates in erl_eval
Diffstat (limited to 'lib/debugger/src/dbg_ieval.erl')
-rw-r--r--lib/debugger/src/dbg_ieval.erl16
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/debugger/src/dbg_ieval.erl b/lib/debugger/src/dbg_ieval.erl
index 1d36aae8ee..0653ce4c00 100644
--- a/lib/debugger/src/dbg_ieval.erl
+++ b/lib/debugger/src/dbg_ieval.erl
@@ -663,12 +663,16 @@ expr({map,Line,Fs0}, Bs0, Ieval) ->
expr({map,Line,E0,Fs0}, Bs0, Ieval0) ->
Ieval = Ieval0#ieval{line=Line,top=false},
{value,E,Bs1} = expr(E0, Bs0, Ieval),
- {Fs,Bs2} = eval_map_fields(Fs0, Bs1, Ieval),
- Value = lists:foldl(fun ({map_assoc,K,V}, Mi) -> maps:put(K,V,Mi);
- ({map_exact,K,V}, Mi) -> maps:update(K,V,Mi) end,
- E, Fs),
- {value,Value,Bs2};
-
+ case E of
+ #{} ->
+ {Fs,Bs2} = eval_map_fields(Fs0, Bs1, Ieval),
+ Value = lists:foldl(fun ({map_assoc,K,V}, Mi) -> maps:put(K,V,Mi);
+ ({map_exact,K,V}, Mi) -> maps:update(K,V,Mi)
+ end, E, Fs),
+ {value,Value,Bs2};
+ _ ->
+ exception(error, {badarg,E}, Bs1, Ieval)
+ end;
%% A block of statements
expr({block,Line,Es},Bs,Ieval) ->
seq(Es, Bs, Ieval#ieval{line=Line});