File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -477,10 +477,16 @@ bool SILFunction::hasValidLinkageForFragileRef() const {
477
477
if (hasValidLinkageForFragileInline ())
478
478
return true ;
479
479
480
- // If the containing module has been serialized
481
- if (getModule ().isSerialized ()) {
480
+ // If the containing module has been serialized already, we no longer
481
+ // enforce any invariants.
482
+ if (getModule ().isSerialized ())
482
483
return true ;
483
- }
484
+
485
+ // If the function has a subclass scope that limits its visibility outside
486
+ // the module despite its linkage, we cannot reference it.
487
+ if (getClassSubclassScope () == SubclassScope::Resilient &&
488
+ isAvailableExternally ())
489
+ return false ;
484
490
485
491
// Otherwise, only public functions can be referenced.
486
492
return hasPublicVisibility (getLinkage ());
You can’t perform that action at this time.
0 commit comments