Skip to content

Commit

Permalink
fix interpreter test IR and missing OpaqueClosure debuginfo
Browse files Browse the repository at this point in the history
  • Loading branch information
vtjnash committed Mar 5, 2024
1 parent 2868ffc commit ec6eaeb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions base/opaque_closure.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ function Core.OpaqueClosure(ir::IRCode, @nospecialize env...;
do_compile::Bool = true)
# NOTE: we need ir.argtypes[1] == typeof(env)
ir = Core.Compiler.copy(ir)
# if the user didn't specify a definition MethodInstance or filename Symbol to use for the debuginfo, set a filename now
@something ir.debuginfo.def ir.debuginfo.def=var"generated IR for OpaqueClosure"
nargs = length(ir.argtypes)-1
sig = compute_oc_signature(ir, nargs, isva)
rt = compute_ir_rettype(ir)
Expand Down
7 changes: 5 additions & 2 deletions test/compiler/interpreter_exec.jl
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ let m = Meta.@lower 1 + 1
QuoteNode(:b),
GlobalRef(@__MODULE__, :test29262),
# block 2
EnterNode(11),
EnterNode(12),
# block 3
UpsilonNode(),
UpsilonNode(),
Expand All @@ -91,11 +91,13 @@ let m = Meta.@lower 1 + 1
UpsilonNode(SSAValue(1)),
# block 5
Expr(:throw_undef_if_not, :expected, false),
ReturnNode(), # unreachable
# block 6
PhiCNode(Any[SSAValue(5), SSAValue(7), SSAValue(9)]), # NULL, :a, :b
PhiCNode(Any[SSAValue(6)]), # NULL
Expr(:pop_exception, SSAValue(4)),
# block 7
ReturnNode(SSAValue(11)),
ReturnNode(SSAValue(12)),
]
nstmts = length(src.code)
src.ssavaluetypes = nstmts
Expand All @@ -106,4 +108,5 @@ let m = Meta.@lower 1 + 1
@test :a === @eval $m
global test29262 = false
@test :b === @eval $m
@test isempty(Base.catch_stack())
end

0 comments on commit ec6eaeb

Please sign in to comment.