mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
If bad data is fed to the reader, it might be convinced it's looking at a generic type. If the generic type parameter also happens to be the same metadata pointer, an infinite recursion results. To prevent this, insert an invalid type into the cache at the start of the read. If we then ask for that same metadata pointer again, we'll return the invalid/empty built type. This also might improve performance a little by preventing rereading and rebuilding types. rdar://problem/26529650