File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -2074,7 +2074,16 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
2074
2074
// from a fragile function is an error.
2075
2075
if (F.isSerialized ()) {
2076
2076
require ((SingleFunction && RefF->isExternalDeclaration ()) ||
2077
- RefF->hasValidLinkageForFragileRef (),
2077
+ RefF->hasValidLinkageForFragileRef () ||
2078
+
2079
+ // A serialized specialized function can reference another
2080
+ // specialized function. In case the other specialization is already
2081
+ // generated by the optimizer before the de-serialization point,
2082
+ // we can end up that a shared_external function references a
2083
+ // shared function. This is okay.
2084
+ (F.getLinkage () == SILLinkage::SharedExternal &&
2085
+ RefF->getLinkage () == SILLinkage::Shared),
2086
+
2078
2087
" function_ref inside fragile function cannot "
2079
2088
" reference a private or hidden symbol" );
2080
2089
}
Original file line number Diff line number Diff line change @@ -511,6 +511,10 @@ void CrossModuleOptimization::makeDeclUsableFromInline(ValueDecl *decl) {
511
511
if (decl->getEffectiveAccess () >= AccessLevel::Public)
512
512
return ;
513
513
514
+ // We must not modify decls which are defined in other modules.
515
+ if (M.getSwiftModule () != decl->getDeclContext ()->getParentModule ())
516
+ return ;
517
+
514
518
if (decl->getFormalAccess () < AccessLevel::Public &&
515
519
!decl->isUsableFromInline ()) {
516
520
// Mark the nominal type as "usableFromInline".
You can’t perform that action at this time.
0 commit comments