-
Notifications
You must be signed in to change notification settings - Fork 10.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Debug Info] Add missing caching for types with no type sugar #80179
Conversation
DBuilder::replaceTemporary() can return a different pointer. In practice this only happens when temporary and replacement are uniqued, so that's probably how we got away with this in the past.
when creating the members of a struct, to avoid problems when the type graph changes due to type nodes being uniqued. It's not clear this can actually happen, but it helps ruling this out as a failure cause.
This avoids redundant creation and uniquing of types in the case where we only have a canonical name. Since the uniquing changes the type graph this introduced the possibility for use-after-free if IRGenDebugInfoImpl held on to a direct (non-tracking) DIType *. rdar://146327709
@swift-ci test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess writing a test which would result in a use after free before the fix isn't easily done, right?
The reason I didn't bother reducing the type out of the crashing program is that the assertion is an even stronger precondition for the use-after-free and we already trigger it with two tests in the existing test suite. |
@swift-ci test macos |
@swift-ci please test source compatibility |
|
This avoids redundant creation and uniquing of types in the case where
we only have a canonical name. Since the uniquing changes the type
graph this introduced the possibility for use-after-free if
IRGenDebugInfoImpl held on to a direct (non-tracking) DIType *.
rdar://146327709
depends on #80170