Skip to content

Commit a0d0d33

Browse files
authored
Adjust to upcoming julia lowering change (#592)
See JuliaLang/julia#51590.
1 parent a3cf18e commit a0d0d33

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

src/interpret.jl

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -483,12 +483,22 @@ function step_expr!(@nospecialize(recurse), frame, @nospecialize(node), istoplev
483483
rhs = node.args[1]::Int
484484
push!(data.exception_frames, rhs)
485485
elseif node.head === :leave
486-
for _ = 1:node.args[1]::Int
487-
pop!(data.exception_frames)
486+
if length(node.args) == 1 && isa(node.args[1], Int)
487+
arg = node.args[1]::Int
488+
for _ = 1:arg
489+
pop!(data.exception_frames)
490+
end
491+
else
492+
for i = 1:length(node.args)
493+
targ = node.args[i]
494+
targ === nothing && continue
495+
frame.framecode.src.code[(targ::SSAValue).id] === nothing && continue
496+
pop!(data.exception_frames)
497+
end
488498
end
489499
elseif node.head === :pop_exception
490-
n = lookup_var(frame, node.args[1]::SSAValue)::Int
491-
deleteat!(data.exception_frames, n+1:length(data.exception_frames))
500+
# TODO: This needs to handle the exception stack properly
501+
# (https://github.com/JuliaDebug/JuliaInterpreter.jl/issues/591)
492502
elseif node.head === :return
493503
return nothing
494504
elseif istoplevel

0 commit comments

Comments
 (0)