File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
SwiftCompilerSources/Sources/Optimizer/FunctionPasses Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -153,10 +153,10 @@ private struct CollectedEffects {
153
153
// handleApply above is sufficient. And, if they are not applied
154
154
// in this function, then they are never applied.
155
155
if !pa. isOnStack {
156
- // the callee and its arguments are all captured.. .
157
- for operand in pa. operands {
158
- if operand . value . type. isAddress {
159
- addEffects ( . read, to: operand . value )
156
+ // callee is never an address .
157
+ for argument in pa. arguments {
158
+ if argument . type. isAddress {
159
+ addEffects ( . read, to: argument )
160
160
}
161
161
}
162
162
}
Original file line number Diff line number Diff line change @@ -1932,6 +1932,10 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
1932
1932
require (resultInfo->getExtInfo ().hasContext (),
1933
1933
" result of closure cannot have a thin function type" );
1934
1934
1935
+ // We rely on all indirect captures to be in the argument list.
1936
+ require (PAI->getCallee ()->getType ().isObject (),
1937
+ " Closure callee must not be an address type." );
1938
+
1935
1939
checkApplyTypeDependentArguments (PAI);
1936
1940
1937
1941
auto substTy = checkApplySubstitutions (PAI->getSubstitutionMap (),
You can’t perform that action at this time.
0 commit comments