Fix segfault when processing types with unresolved lifetimes in generic arguments#4436
Open
v1bh475u wants to merge 3 commits intoRust-GCC:masterfrom
Open
Fix segfault when processing types with unresolved lifetimes in generic arguments#4436v1bh475u wants to merge 3 commits intoRust-GCC:masterfrom
v1bh475u wants to merge 3 commits intoRust-GCC:masterfrom
Conversation
e178f86 to
b9b1d7c
Compare
gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-type.cc (TypeCheckType::resolve_root_path): check for unresolved lifetimes. Signed-off-by: vibhatsu <maulikbarot2915@gmail.com>
gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit): propagate error type in ReferenceType resolution Signed-off-by: vibhatsu <maulikbarot2915@gmail.com>
gcc/testsuite/ChangeLog: * rust/compile/unresolved-lifetime-in-generic-arg.rs: New test. Signed-off-by: vibhatsu <maulikbarot2915@gmail.com>
b9b1d7c to
d4b0c14
Compare
Author
|
The build fails due to filename. Will fix it but need help for the changelog. After we are certain about the changelog, I will do a final rebase to finish all the changes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
make check-rustpasses locallyclang-formatgcc/testsuite/rust/Fixes #3611
When resolving type paths with generic arguments, if a lifetime fails to resolve,
regions_from_generic_args()returns an empty vector. Previously, this empty vector was passed toSubstMapper::Resolve, creating types with uninitialized Region data. Later, variance analysis would crash when processing these malformed types.Fix:
resolve_root_path(): check ifregions_from_generic_args()failed and returnErrorTypeimmediately instead of creating malformed typesvisit(ReferenceType&): propagateErrorTypewhen encountered