Skip to content

Commit a86d338

Browse files
committed
[ast] After determining that the AST has an isolated capture, make sure that we actually process it via an assert.
A little paranoia never hurts.
1 parent f48bd90 commit a86d338

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/SIL/IR/SILFunctionType.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1961,8 +1961,10 @@ lowerCaptureContextParameters(TypeConverter &TC, SILDeclRef function,
19611961
auto canType = type->getReducedType(origGenericSig);
19621962

19631963
auto options = SILParameterInfo::Options();
1964-
if (isolatedParam == varDecl)
1964+
if (isolatedParam == varDecl) {
19651965
options |= SILParameterInfo::Isolated;
1966+
isolatedParam = nullptr;
1967+
}
19661968

19671969
// If we're capturing a parameter pack, wrap it in a tuple.
19681970
if (isa<PackExpansionType>(canType)) {
@@ -2043,6 +2045,9 @@ lowerCaptureContextParameters(TypeConverter &TC, SILDeclRef function,
20432045
}
20442046
}
20452047
}
2048+
assert(!isolatedParam &&
2049+
"If we had an isolated capture, we should have visited it when "
2050+
"iterating over loweredCaptures.getCaptures().");
20462051
}
20472052

20482053
static AccessorDecl *

0 commit comments

Comments
 (0)