Skip to content

Commit

Permalink
dbg_ieval: Properly handle exceptions when binary construction fails
Browse files Browse the repository at this point in the history
An exception from eval_bits:expr_grp/5 (for constructing binaries)
was not caught and handled by exception/4; thus exit_info and
and stacktrace for the process was not set.
  • Loading branch information
bjorng committed Aug 16, 2011
1 parent f2e0e97 commit bbb3790
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions lib/debugger/src/dbg_ieval.erl
Expand Up @@ -925,10 +925,15 @@ expr({send,Line,To0,Msg0}, Bs0, Ieval0) ->
%% Binary
expr({bin,Line,Fs}, Bs0, Ieval0) ->
Ieval = Ieval0#ieval{line=Line},
eval_bits:expr_grp(Fs, Bs0,
fun (E, B) -> expr(E, B, Ieval) end,
[],
false);
try
eval_bits:expr_grp(Fs, Bs0,
fun (E, B) -> expr(E, B, Ieval) end,
[],
false)
catch
Class:Reason ->
exception(Class, Reason, Bs0, Ieval)
end;

%% List comprehension
expr({lc,_Line,E,Qs}, Bs, Ieval) ->
Expand Down

0 comments on commit bbb3790

Please sign in to comment.