Skip to content

Commit

Permalink
Don't assume that method1 is always in a thunk
Browse files Browse the repository at this point in the history
Fixes Revise test failures in JuliaLang/julia#57346.
  • Loading branch information
Keno committed Feb 11, 2025
1 parent b919241 commit 43504ae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lowered.jl
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,9 @@ function methods_by_execution!(@nospecialize(recurse), methodinfo, docexprs, fra
end
end
end
pc = next_or_nothing!(frame)
@assert length(stmt.args) == 1
pc = mode !== :sigs ? step_expr!(recurse, frame, stmt, true) :
next_or_nothing!(frame)
else
pc, pc3 = ret
# Get the line number from the body
Expand Down
1 change: 1 addition & 0 deletions test/backedges.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ do_test("Backedges") && @testset "Backedges" begin
laststmt = src.code[end]
@assert isa(laststmt, Core.ReturnNode)
to_skip = isa(laststmt.val, Revise.JuliaInterpreter.SSAValue) ? 2 : 1
# Revise.LoweredCodeUtils.print_with_code(stdout, src, isrequired)
@test sum(isrequired) == length(src.code)-count(e->isexpr(e, :latestworld), src.code)-to_skip # skips the `return` at the end (and its argument)

src = """
Expand Down

0 comments on commit 43504ae

Please sign in to comment.