-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
crash with isdefined
inside try block inside loop
#32820
Labels
bug
Indicates an unexpected problem or unintended behavior
Comments
isdefined
inside try block inside loopisdefined
inside try block inside loop
It looks like the SSA construction analysis doesn't annotate the julia> ir = (@code_typed optimize=false f(Any[1]))[1];
julia> sv = Core.Compiler.OptimizationState(Core.Compiler.method_instances(f, (Vector{Any},))[1], ir, Core.Compiler.Params(Base.get_world_counter()))
julia> Core.Compiler.just_construct_ssa(ir, ir.code, 2, sv)
2 1 ── nothing::Any
3 │ %2 = _2::Array{Any,1}
│ %3 = Base.iterate(%2)::Union{Nothing, Tuple{Any,Int64}}
│ %4 = (%3 === nothing)::Bool
│ %5 = Base.not_int(%4)::Bool
└─── goto #10 if not %5
2 ┄─ %29 = φ (#1 => #undef, #9 => %28)::Core.Compiler.MaybeUndef(Array{Any,1})
│ %30 = φ (#1 => %3, #9 => %21)::Union{Nothing, Tuple{Any,Int64}}
│ %31 = π (%30, Tuple{Any,Int64})
│ %7 = %31::Tuple{Any,Int64}
│ Core.getfield(%7, 1)::Any
└─── %9 = Core.getfield(%7, 2)::Int64
4 3 ── %32 = ϒ (%29)::Array{Any,1}
└─── %10 = $(Expr(:enter, #5))
5 4 ── Main.error()::Union{}
└─── unreachable
5 ── %27 = φᶜ (%32)::Array{Any,1}
└─── $(Expr(:leave, 1))
6 ── $(Expr(:the_exception))::Any
7 │ %15 = $(Expr(:isdefined, :(%27)))::Bool
│ %16 = !%15::Bool
└─── goto #8 if not %16
8 7 ── %18 = Base.vect()::Array{Any,1}
10 8 ┄─ %28 = φ (#7 => %18, #6 => %27)::Array{Any,1}
│ $(Expr(:undefcheck, :x, :(%28)))::Any
│ Main.push!(%28, 1)::Any
│ $(Expr(:pop_exception, :(%10)))::Any
│ %21 = Base.iterate(%2, %9)::Union{Nothing, Tuple{Any,Int64}}
│ %22 = (%21 === nothing)::Bool
│ %23 = Base.not_int(%22)::Bool
└─── goto #10 if not %23
9 ── goto #2
10 ┄ return nothing |
Oooh, I wonder if this was one of the causes of |
Keno
added a commit
that referenced
this issue
Aug 8, 2019
Keno
added a commit
that referenced
this issue
Aug 8, 2019
KristofferC
pushed a commit
that referenced
this issue
Aug 26, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
gives
in all julia versions since 1.0.
The text was updated successfully, but these errors were encountered: