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

gccrs: catch missing guard for optional result #3380

Merged
merged 1 commit into from
Jan 28, 2025

Conversation

philberty
Copy link
Member

When we lookup here it returns an optional which can lead to a crash because it needs a guard if it has a value.

gcc/rust/ChangeLog:

* backend/rust-compile-resolve-path.cc (HIRCompileBase::query_compile): add guard

gcc/testsuite/ChangeLog:

* rust/compile/nr2/exclude: these tests now work it seems

@philberty philberty added the bug label Jan 23, 2025
@philberty philberty added this to the Codegen fixes milestone Jan 23, 2025
When we lookup here it returns an optional which can lead to a crash
because it needs a guard if it has a value.

gcc/rust/ChangeLog:

	* backend/rust-compile-resolve-path.cc (HIRCompileBase::query_compile): add guard

gcc/testsuite/ChangeLog:

	* rust/compile/nr2/exclude: these tests now work it seems

Signed-off-by: Philip Herron <[email protected]>
@philberty philberty force-pushed the phil/fix-possible-crash branch from 67b21ec to 379b322 Compare January 28, 2025 13:39
Copy link
Member

@CohenArthur CohenArthur left a comment

Choose a reason for hiding this comment

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

LGTM!

@CohenArthur CohenArthur added this pull request to the merge queue Jan 28, 2025
Merged via the queue into master with commit 60e0d04 Jan 28, 2025
12 checks passed
@philberty philberty deleted the phil/fix-possible-crash branch January 29, 2025 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants