Skip to content

Commit 144e993

Browse files
committed
[Serialization] Add assertions to track down a SIL deserialization issue.
The issue: we're apparently not keeping the archetypes in an instruction in sync with the archetypes used in the SIL function's generic signature. This apparently isn't the problem, but it's a good assertion to have, if a little ad hoc. (The actual issue is rdar://problem/23892955.)
1 parent 38b483d commit 144e993

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/Serialization/Deserialization.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,11 @@ ModuleFile::maybeReadSubstitution(llvm::BitstreamCursor &cursor) {
579579
replacementID,
580580
numConformances);
581581

582+
if (&cursor == &SILCursor) {
583+
assert(Types[archetypeID-1].isComplete() &&
584+
"SIL substitutions should always reference existing archetypes");
585+
}
586+
582587
auto archetypeTy = getType(archetypeID)->castTo<ArchetypeType>();
583588
auto replacementTy = getType(replacementID);
584589

0 commit comments

Comments
 (0)