We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
SILModule::willDeleteInstruction
1 parent 82e7e9a commit d03e5daCopy full SHA for d03e5da
lib/SIL/IR/SILModule.cpp
@@ -264,9 +264,11 @@ void SILModule::willDeleteInstruction(SILInstruction *I) {
264
if (const CanOpenedArchetypeType archeTy =
265
svi->getDefinedOpenedArchetype()) {
266
OpenedArchetypeKey key = {archeTy, svi->getFunction()};
267
- assert(RootOpenedArchetypeDefs.lookup(key) == svi &&
268
- "archetype def was not registered");
269
- RootOpenedArchetypeDefs.erase(key);
+ // In case `willDeleteInstruction` is called twice for the same instruction,
+ // we need to check if the archetype is really still in the map for this
+ // instruction.
270
+ if (RootOpenedArchetypeDefs.lookup(key) == svi)
271
+ RootOpenedArchetypeDefs.erase(key);
272
}
273
274
0 commit comments