using IRTools
using IRTools: evalir
function trycatch()
try
catch _
end
end
ir = @code_ir trycatch()
evalir(ir, trycatch)
Error:
BoundsError: attempt to access 2-element Array{Core.Compiler.BasicBlock,1} at index [4]
getindex(::Array{Core.Compiler.BasicBlock,1}, ::Int64) at array.jl:744
replace_code_newstyle!(::Core.CodeInfo, ::Core.Compiler.IRCode, ::Int64) at legacy.jl:91
update!(::Core.CodeInfo, ::Core.Compiler.IRCode) at utils.jl:95
update! at utils.jl:103 [inlined]
build_codeinfo(::IRTools.Inner.IR) at eval.jl:13
#s148#251(::Any, ::Any) at eval.jl:18
(::Core.GeneratedFunctionStub)(::Any, ::Vararg{Any,N} where N) at boot.jl:524
#invokelatest#1(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::typeof(Base.invokelatest), ::Any, ::Any, ::Vararg{Any,N} where N) at essentials.jl:709
invokelatest(::Any, ::Any, ::Vararg{Any,N} where N) at essentials.jl:708
evalir(::Module, ::IRTools.Inner.IR, ::Function, ::Vararg{Any,N} where N) at eval.jl:24
evalir(::IRTools.Inner.IR, ::Function) at eval.jl:25
top-level scope at runtests.jl:40
And obviously, this also happens when hooking a dynamo on a function with try/catch block.
MRE:
Error:
And obviously, this also happens when hooking a dynamo on a function with
try/catch
block.