diff options
author | Anthony Ramine <[email protected]> | 2014-03-08 18:12:13 +0100 |
---|---|---|
committer | Anthony Ramine <[email protected]> | 2014-03-15 21:27:23 +0100 |
commit | 5bc10a4ed286247274efa338b7d82b2d1f5534d6 (patch) | |
tree | b0d976eef8038db6c0e7d4afe2c46d9809abe4fd /lib/debugger/src/dbg_ieval.erl | |
parent | 766b8d3877a9c304e61828af4f376c5c4fb70a8e (diff) | |
download | otp-5bc10a4ed286247274efa338b7d82b2d1f5534d6.tar.gz otp-5bc10a4ed286247274efa338b7d82b2d1f5534d6.tar.bz2 otp-5bc10a4ed286247274efa338b7d82b2d1f5534d6.zip |
Fix evaluation of empty map updates in the debugger
Diffstat (limited to 'lib/debugger/src/dbg_ieval.erl')
-rw-r--r-- | lib/debugger/src/dbg_ieval.erl | 16 |
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}); |