Skip to content
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

optimizer: SROA should preserve statement that may throw #48067

Closed
aviatesk opened this issue Jan 1, 2023 · 0 comments · Fixed by #48068
Closed

optimizer: SROA should preserve statement that may throw #48067

aviatesk opened this issue Jan 1, 2023 · 0 comments · Fixed by #48068
Labels
compiler:optimizer Optimization passes (mostly in base/compiler/ssair/)

Comments

@aviatesk
Copy link
Member

aviatesk commented Jan 1, 2023

julia> @inline function foo(a::Int, b)
           r = Ref(a)
           try
               setfield!(r, :x, b)
               nothing
           catch err
               return 42
           end
       end
foo (generic function with 1 method)

julia> code_typed(foo, (Int,String))
1-element Vector{Any}:
 CodeInfo(
1nothing::Nothing
2%2 = $(Expr(:enter, #4))
3 ─      unreachable
4$(Expr(:leave, 1))
5$(Expr(:pop_exception, :(%2)))::Any
└──      return 42
) => Int64

julia> foo(42, "julia")

[26644] signal (4.1): Illegal instruction: 4
in expression starting at REPL[10]:1
...
@aviatesk aviatesk added the compiler:optimizer Optimization passes (mostly in base/compiler/ssair/) label Jan 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:optimizer Optimization passes (mostly in base/compiler/ssair/)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant