mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
GenericSpecializer: drop unused indirect arguments.
If there is no read from an indirect argument, this argument has to be dropped. At the call site the store to the argument's memory location could have been removed (based on the callee's memory effects). Therefore, converting such an unused indirect argument to a direct argument, would load an uninitialized value at the call site. This would lead to verifier errors and in worst case to a miscompile because IRGen can implicitly use dead arguments, e.g. for getting the type of a class reference.
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
// CHECK: sil private @top_level_code
|
||||
// CHECK: sil public_external [serialized] [ossa] @$ss1XVABycfC{{.*}}
|
||||
// CHECK: sil public_external [serialized] [ossa] @$ss17the_thing_it_does1xys1XV_tF{{.*}}
|
||||
// CHECK: sil shared [serialized] [noinline] [ossa] @$ss9the_thing1tyx_tlFs1XV_Tgq5{{.*}}
|
||||
// CHECK: sil shared [serialized] [noinline] [ossa] @$ss9the_thing1tyx_tlFs1XV_Ttgq5{{.*}}
|
||||
|
||||
sil_stage canonical
|
||||
|
||||
|
||||
Reference in New Issue
Block a user