mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
SILModule: track opened archetypes per function.
In theory we could map opened archetypes per module because opened archetypes _should_ be unique across the module. But currently in some rare cases SILGen re-uses the same opened archetype in multiple functions. The fix is to add the SILFunction to the map's key. That also requires that we update the map whenever instructions are moved from one function to another. This fixes a compiler crash. rdar://76916931
This commit is contained in:
@@ -76,7 +76,7 @@ static void buildTypeDependentOperands(
|
||||
SmallVectorImpl<SILValue> &TypeDependentOperands, SILFunction &F) {
|
||||
|
||||
for (auto archetype : OpenedArchetypes) {
|
||||
SILValue def = F.getModule().getOpenedArchetypeDef(archetype);
|
||||
SILValue def = F.getModule().getOpenedArchetypeDef(archetype, &F);
|
||||
assert(def->getFunction() == &F &&
|
||||
"def of opened archetype is in wrong function");
|
||||
TypeDependentOperands.push_back(def);
|
||||
|
||||
Reference in New Issue
Block a user