Skip to content

Commit c7429f0

Browse files
authored
Merge pull request #79448 from compnerd/addressability
IRGen: adjust addressability of the generic metadata
2 parents acbae0c + c0b612c commit c7429f0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/IRGen/MetadataRequest.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -836,6 +836,12 @@ bool irgen::isSpecializedNominalTypeMetadataStaticallyAddressable(
836836
if (IGM.getSwiftModule() == nominal->getModuleContext()) {
837837
return false;
838838
}
839+
// We cannot reference the type context across the module boundary on
840+
// PE/COFF without a load. This prevents us from statically initializing the
841+
// pattern.
842+
if (IGM.Triple.isOSWindows() &&
843+
!nominal->getModuleContext()->isStaticLibrary())
844+
return false;
839845
if (nominal->isResilient(IGM.getSwiftModule(),
840846
ResilienceExpansion::Maximal)) {
841847
return false;

0 commit comments

Comments
 (0)