Avatar
// function_ref closure #2 in f() %16 = function_ref @$s1a1fyyFyyyczXEfU0_ : $@convention(thin) @substituted <τ_0_0> (@inout τ_0_0, @guaranteed String) -> () for <() -> ()> // user: %18 retain_value %14 : $String // id: %17 %18 = partial_apply [callee_guaranteed] [on_stack] %16(%14) : $@convention(thin) @substituted <τ_0_0> (@inout τ_0_0, @guaranteed String) -> () for <() -> ()> // users: %22, %19 %19 = mark_dependence %18 : $@noescape @callee_guaranteed @substituted <τ_0_0> (@inout τ_0_0) -> () for <() -> ()> on %14 : $String // user: %21 %20 = class_method %6 : $Box<() -> ()>, #Box.mutate : <T> (Box<T>) -> ((inout T) -> ()) -> (), $@convention(method) <τ_0_0> (@noescape @callee_guaranteed @substituted <τ_0_0> (@inout τ_0_0) -> () for <τ_0_0>, @guaranteed Box<τ_0_0>) -> () // user: %21 %21 = apply %20<() -> ()>(%19, %6) : $@convention(method) <τ_0_0> (@noescape @callee_guaranteed @substituted <τ_0_0> (@inout τ_0_0) -> () for <τ_0_0>, @guaranteed Box<τ_0_0>) -> () dealloc_stack %18 : $@noescape @callee_guaranteed @substituted <τ_0_0> (@inout τ_0_0) -> () for <() -> ()> // id: %22 release_value %14 : $String // id: %23 release_value %14 : $String // id: %24 strong_release %6 : $Box<() -> ()> // id: %25
5:49 AM
Swift 5.8だと、%14 = inout のブロックに渡してる s が2回 release されることでクラッシュですね... SIL の時点でおかしい (edited)