Skip to content

[lldb] Iterate over a snapshot of the modules to be added in SetupRef… #7091

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

Merged

Conversation

augusto2112
Copy link

…lection

SwiftLanguageRuntimeImpl::SetupReflection is potentially recursive. To guard against any potential problems of iterating over the modules to be added list and mutating it at the same time, create a snapshot of said list and iterate over that instead.

rdar://108767207

@augusto2112
Copy link
Author

@swift-ci test

@@ -522,12 +529,11 @@ void SwiftLanguageRuntimeImpl::SetupReflection() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

m_modules_to_add has been cleared when you reach the Progress initializer. I think you want the snapshot here?

…lection

SwiftLanguageRuntimeImpl::SetupReflection is potentially recursive. To guard
against any potential problems of iterating over the modules to be added list
and mutating it at the same time, create a snapshot of said list and iterate
over that instead.

rdar://108767207
@augusto2112 augusto2112 force-pushed the snapshot-setup-refl branch from a75a77f to 10a9e64 Compare July 21, 2023 16:59
@augusto2112
Copy link
Author

@swift-ci test

@augusto2112
Copy link
Author

@swift-ci test windows

@adrian-prantl adrian-prantl self-requested a review July 21, 2023 19:33
@adrian-prantl adrian-prantl merged commit ea47328 into swiftlang:swift/release/5.9 Jul 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants