File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -4044,15 +4044,20 @@ void SILWitnessTable::verify(const SILModule &M) const {
4044
4044
4045
4045
auto *protocol = getConformance ()->getProtocol ();
4046
4046
4047
- // Currently all witness tables have public conformances, thus witness tables
4048
- // should not reference SILFunctions without public/public_external linkage.
4049
- // FIXME: Once we support private conformances, update this.
4050
4047
for (const Entry &E : getEntries ())
4051
4048
if (E.getKind () == SILWitnessTable::WitnessKind::Method) {
4052
4049
SILFunction *F = E.getMethodWitness ().Witness ;
4053
4050
if (F) {
4054
- assert (!isLessVisibleThan (F->getLinkage (), getLinkage ()) &&
4055
- " Witness tables should not reference less visible functions." );
4051
+ // If a SILWitnessTable is going to be serialized, it must only
4052
+ // reference public or shared [fragile] functions.
4053
+ if (isFragile ()) {
4054
+ assert ((!isLessVisibleThan (F->getLinkage (), getLinkage ()) ||
4055
+ (F->isFragile () &&
4056
+ F->getLinkage () == SILLinkage::Shared)) &&
4057
+ " Fragile witness tables should not reference "
4058
+ " less visible functions." );
4059
+ }
4060
+
4056
4061
assert (F->getLoweredFunctionType ()->getRepresentation () ==
4057
4062
SILFunctionTypeRepresentation::WitnessMethod &&
4058
4063
" Witnesses must have witness_method representation." );
You can’t perform that action at this time.
0 commit comments