mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Force generic parameter types declared in module context to belong to
the current SIL module, unless the AST sees them first. This turns out to be important when we deserialize generic reabstraction thunks, which have shared linkage so get serialized again in the current SIL module. There are some fundamental inconsistencies in the way parameter type decls are handled, but we need a quick workaround to unblock progress on the stdlib. Fixes <rdar://problem/16807985> Building Foundation overlay crashes in stdlib deserialization in r17377 Swift SVN r18173
This commit is contained in:
@@ -1136,6 +1136,8 @@ void Serializer::writeCrossReference(const Decl *D) {
|
||||
writeCrossReference(D->getDeclContext());
|
||||
|
||||
if (auto genericParam = dyn_cast<GenericTypeParamDecl>(D)) {
|
||||
assert(!D->getDeclContext()->isModuleScopeContext() &&
|
||||
"Cannot cross reference a generic type decl at module scope.");
|
||||
abbrCode = DeclTypeAbbrCodes[XRefGenericParamPathPieceLayout::Code];
|
||||
XRefGenericParamPathPieceLayout::emitRecord(Out, ScratchRecord, abbrCode,
|
||||
genericParam->getIndex());
|
||||
|
||||
Reference in New Issue
Block a user