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

Fix CC1Main setting trigger undefined behavior #4714

Merged
merged 1 commit into from
Jan 3, 2025

Conversation

bricknerb
Copy link
Contributor

@bricknerb bricknerb commented Dec 19, 2024

This is caused by setting a temporary lambda to a llvm::function_ref.
The fix is to assign the lambda into a variable that outlives the llvm::function_ref.

Copy link
Contributor

@jonmeow jonmeow left a comment

Choose a reason for hiding this comment

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

Nice catch!

toolchain/driver/clang_runner.cpp Outdated Show resolved Hide resolved
Copy link
Contributor

@chandlerc chandlerc left a comment

Choose a reason for hiding this comment

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

Nice! Giving the LG so you can merge in your TZ.

This is caused by setting a temporary lambda to a `llvm::function_ref`.
The fix is to assign the lambda into a variable that outlives the `llvm::function_ref`.
@bricknerb bricknerb added this pull request to the merge queue Jan 3, 2025
Merged via the queue into carbon-language:trunk with commit fa9d838 Jan 3, 2025
8 checks passed
@bricknerb bricknerb deleted the cc1main branch January 3, 2025 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants