Skip to content

Commit

Permalink
Adjust to upcoming julia lowering change (#592)
Browse files Browse the repository at this point in the history
  • Loading branch information
Keno authored Oct 10, 2023
1 parent a3cf18e commit a0d0d33
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/interpret.jl
Original file line number Diff line number Diff line change
Expand Up @@ -483,12 +483,22 @@ function step_expr!(@nospecialize(recurse), frame, @nospecialize(node), istoplev
rhs = node.args[1]::Int
push!(data.exception_frames, rhs)
elseif node.head === :leave
for _ = 1:node.args[1]::Int
pop!(data.exception_frames)
if length(node.args) == 1 && isa(node.args[1], Int)
arg = node.args[1]::Int
for _ = 1:arg
pop!(data.exception_frames)
end
else
for i = 1:length(node.args)
targ = node.args[i]
targ === nothing && continue
frame.framecode.src.code[(targ::SSAValue).id] === nothing && continue
pop!(data.exception_frames)
end
end
elseif node.head === :pop_exception
n = lookup_var(frame, node.args[1]::SSAValue)::Int
deleteat!(data.exception_frames, n+1:length(data.exception_frames))
# TODO: This needs to handle the exception stack properly
# (https://github.com/JuliaDebug/JuliaInterpreter.jl/issues/591)
elseif node.head === :return
return nothing
elseif istoplevel
Expand Down

0 comments on commit a0d0d33

Please sign in to comment.