Skip to content

Commit 21bc219

Browse files
committed
[Serialization] Turn an impossible case into an assertion.
The "ID" here is a temporary unique number internal to the SIL deserializer. Swift SVN r28579
1 parent 6786158 commit 21bc219

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

lib/Serialization/DeserializeSIL.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -258,12 +258,11 @@ SILBasicBlock *SILDeserializer::getBBForDefinition(SILFunction *Fn,
258258
return BB = new (SILMod) SILBasicBlock(Fn);
259259

260260
// If it already exists, it was either a forward reference or a redefinition.
261-
// If it is a forward reference, it should be in our undefined set.
262-
if (!UndefinedBlocks.erase(BB)) {
263-
// If we have a redefinition, return a new BB to avoid inserting
264-
// instructions after the terminator.
265-
return new (SILMod) SILBasicBlock(Fn);
266-
}
261+
// The latter should never happen.
262+
bool wasForwardReferenced = UndefinedBlocks.erase(BB);
263+
assert(wasForwardReferenced);
264+
(void)wasForwardReferenced;
265+
267266
return BB;
268267
}
269268

0 commit comments

Comments
 (0)