Skip to content

Commit

Permalink
Revert "only break if we are throwing an uncaught exception (#89)" (#109
Browse files Browse the repository at this point in the history
)

This reverts commit 28af3b3.
  • Loading branch information
KristofferC authored Mar 6, 2019
1 parent d852de8 commit 390bb66
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
10 changes: 4 additions & 6 deletions src/interpret.jl
Original file line number Diff line number Diff line change
Expand Up @@ -488,11 +488,6 @@ function step_expr!(stack, frame, istoplevel::Bool=false)
end

function handle_err(stack, frame, pc, err)
if !isempty(frame.exception_frames)
# Exception caught
frame.last_exception[] = err
return JuliaProgramCounter(frame.exception_frames[end])
end
if break_on_error[]
frame.pc[] = pc
push!(stack, frame)
Expand All @@ -506,9 +501,12 @@ function handle_err(stack, frame, pc, err)
hasmethod(err.f, arg_types) &&
!hasmethod(err.f, arg_types, world = err.world))
@warn "likely failure to return to toplevel, try JuliaInterpreter.split_expressions"
rethrow(err)
end
end
rethrow(err)
isempty(frame.exception_frames) && rethrow(err)
frame.last_exception[] = err
return JuliaProgramCounter(frame.exception_frames[end])
end

"""
Expand Down
4 changes: 0 additions & 4 deletions test/breakpoints.jl
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,6 @@ end
@test length(stack) >= 2
@test stack[1].code.scope.name == :outer
@test stack[2].code.scope.name == :inner

f_catch() = try error(); catch; return 2; end
@test @interpret f_catch() == 2

finally
JuliaInterpreter.break_on_error[] = false
end
Expand Down

0 comments on commit 390bb66

Please sign in to comment.