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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch Windows search path options to std::string #73518

Merged
merged 1 commit into from
May 9, 2024

Conversation

z2oh
Copy link
Contributor

@z2oh z2oh commented May 8, 2024

A CompilerInvocation object may outlive the input argument list, so we need to copy these argument strings to avoid a use-after-free. This issue was causing sourcekit-lsp to crash whenever these flags showed up in the compile_commands.json used to initialize sourcekit-lsp.

Fixes apple/sourcekit-lsp#1167

cc @compnerd

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

compnerd commented May 8, 2024

@swift-ci please test

@compnerd compnerd merged commit b2bc7a0 into apple:main May 9, 2024
5 checks passed
@ahoppen
Copy link
Contributor

ahoppen commented May 9, 2024

Thanks for fixing @z2oh 🙏🏽

Would you like to also cherry-pick this to release/6.0?

@z2oh
Copy link
Contributor Author

z2oh commented May 9, 2024

Cherry-pick PR is up: #73549

Thanks @ahoppen!

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.

Reliable crash shortly after initialization on Windows
3 participants