You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Only store Mach header addresses for images containing Swift data. (#351)
We currently try to do minimal work in our `objc_addLoadImageFunc()`
callback on Darwin—we acquire a lock, add each reported Mach header to a
list, relinquish the lock, and immediately return. We then look for
appropriate section data on demand in `enumerateTypeMetadataSections()`.
This is a problem if an image is unloaded after the callback to
`objc_addLoadImageFunc()` returns but before we enumerate images. Images
containing Swift do not support unloading, but pure C images might find
themselves in this situation.
This PR checks for the presence of a `"__swift5_types"` section before
adding an image to the list, so references to images that could be
unloaded won't be held indefinitely.
Resolves rdar://124426864.
### Checklist:
- [x] Code and documentation should follow the style of the [Style
Guide](https://github.com/apple/swift-testing/blob/main/Documentation/StyleGuide.md).
- [x] If public symbols are renamed or modified, DocC references should
be updated.
0 commit comments