Skip to content

Commit b3b5151

Browse files
committed
[opened-archetype] When registering values, do not assert on seeing the same definition twice.
Do assert though if we see a different definition. This allows for one to use the same opened archetype tracker to gather dependent types from multiple instructions safely. Previously, any overlap would result in this assert firing. rdar://31521023
1 parent 8309b2c commit b3b5151

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/SIL/SILOpenedArchetypesTracker.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ void SILOpenedArchetypesTracker::addOpenedArchetypeDef(CanArchetypeType archetyp
2828
OldDef = SILValue();
2929
}
3030
}
31-
assert(!OldDef &&
31+
assert((!OldDef || OldDef == Def) &&
3232
"There can be only one definition of an opened archetype");
3333
OpenedArchetypeDefs[archetype] = Def;
3434
}

0 commit comments

Comments
 (0)