Files
swift-mirror/lib/AST/Module.cpp
Robert Widmann 035cecaaa4 Patch a Source of Iterator Invalidation
getOpaqueResultTypeDecl() can wind up invoking lazy function body
parsing when it runs availability checking. If any of those function
bodies have opaque result types, they will be inserted. If that
insertion happens to resize the SetVector, iterators will be invalidated
and a non-deterministic crash results.

Instead, use SetVector::takeVector() for the iteration so we have
a temporary copy whose iterators cannot be invalidated in this
situation. This also elegantly handles clearing out the vector for us.

Resolves rdar://62976771
2020-05-07 14:22:35 -07:00

97 KiB