Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.0馃崚] Switch Windows search path options to std::string #73549

Merged

Conversation

z2oh
Copy link
Contributor

@z2oh z2oh commented May 9, 2024

Explanation: A CompilerInvocation object may outlive the input argument list, so we need to copy these argument strings to avoid a use-after-free
Scope: This fixes a crash in sourcekit-lsp that occurs when any of these flags are present in compile_commands.json
Issue: apple/sourcekit-lsp#1167
Risk: Very low. There is a (almost negligible) bump in memory usage to store copies of these strings. This change will only impact builds on Windows that specify these flags.
Testing: I've tested this patch locally and no longer see sourcekit-lsp crashing with the patch.
Reviewer: @compnerd @ahoppen

(cherry picked from commit 7c64093)

A CompilerInvocation object may outlive the input argument list, so we need to copy these argument strings to avoid a use-after-free

(cherry picked from commit 7c64093)
@z2oh z2oh requested a review from a team as a code owner May 9, 2024 21:26
@compnerd
Copy link
Collaborator

compnerd commented May 9, 2024

@swift-ci please test

@ahoppen ahoppen merged commit a72679c into apple:release/6.0 May 10, 2024
5 checks passed
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.

None yet

5 participants