mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Improve recursion-breaking when resolving type witnesses.
Specifically track when we're resolving type witnesses for a given conformance, and refuse to recursively attempt to resolve those type witnesses. The standard library patch in rdar://problem/21789238 triggers this, and isolating it in a small test case has proven illusive. Swift SVN r30160
This commit is contained in:
@@ -731,6 +731,11 @@ ArrayRef<Substitution> BoundGenericType::getSubstitutions(
|
||||
++index;
|
||||
}
|
||||
|
||||
// Before recording substitutions, make sure we didn't end up doing it
|
||||
// recursively.
|
||||
if (auto known = ctx.getSubstitutions(canon, gpContext))
|
||||
return *known;
|
||||
|
||||
// Copy and record the substitutions.
|
||||
auto permanentSubs = ctx.AllocateCopy(resultSubstitutions,
|
||||
hasTypeVariables
|
||||
|
||||
Reference in New Issue
Block a user