Skip to content

Commit 422d466

Browse files
committed
[Serialization] Fix a bug in the serialization of shared functions.
We do not allow external declarations with shared visibility. This commit makes the serializer translate shared_external linkage to public_external because the serialized functions will be available at runtime. rdar://21989088
1 parent 5542bc3 commit 422d466

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/Serialization/SerializeSIL.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,10 @@ void SILSerializer::writeSILFunction(const SILFunction &F, bool DeclOnly) {
263263
// as available externally.
264264
if (NoBody) {
265265
Linkage = addExternalToLinkage(Linkage);
266+
267+
// We do not allow external declarations with shared visibility.
268+
if (hasSharedVisibility(Linkage))
269+
Linkage = SILLinkage::PublicExternal;
266270
}
267271

268272
SILFunctionLayout::emitRecord(

0 commit comments

Comments
 (0)