Skip to content

Fix generic parameter parsing loop#2125

Merged
CohenArthur merged 1 commit into
Rust-GCC:masterfrom
powerboat9:fix-gparse
Apr 28, 2023
Merged

Fix generic parameter parsing loop#2125
CohenArthur merged 1 commit into
Rust-GCC:masterfrom
powerboat9:fix-gparse

Conversation

@powerboat9

@powerboat9 powerboat9 commented Apr 14, 2023

Copy link
Copy Markdown
Collaborator

Should fix #2102, still trying to figure out how to write the test (if needed)

@powerboat9 powerboat9 changed the title [WIP] Fix generic parameter parsing loop Fix generic parameter parsing loop Apr 14, 2023

@philberty philberty left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM from reading the issue i think a test case of:

struct A<$
// dg-error ...

What is the output you get now?

@philberty philberty requested review from CohenArthur and P-E-P April 16, 2023 14:48
@philberty philberty added the bug label Apr 16, 2023
@philberty philberty added this to the GCC 13.2 release milestone Apr 16, 2023
@powerboat9

Copy link
Copy Markdown
Collaborator Author

I have a test case like that, but dg-error doesn't seem to detect duplicate errors.

@CohenArthur

Copy link
Copy Markdown
Member

@powerboat9 I think the test case is more about the infinite loop, so you should add it. If the testcase does not infinite loop, then #2102 is fixed in my opinion. Your fix looks good

@philberty

Copy link
Copy Markdown
Member

Yeah you might have success with trying the dg-excess-errors option if there are a cascade of errors

@powerboat9

Copy link
Copy Markdown
Collaborator Author

Ok, I got it working.

@CohenArthur CohenArthur left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. I think there was an issue with using dg-timeout in our testsuite but I can't reproduce it, and not having it causes an infinite loop without the fix, so it's clearly needed.

@P-E-P P-E-P left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

gcc/rust/ChangeLog:

	* parse/rust-parse-impl.h
	(Parser::parse_generic_params):
	Handle parameter parsing error.

gcc/testsuite/ChangeLog:

	* rust/compile/issue-2125.rs: New test.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
@CohenArthur CohenArthur added this pull request to the merge queue Apr 28, 2023
Merged via the queue into Rust-GCC:master with commit fef6c56 Apr 28, 2023
@powerboat9 powerboat9 deleted the fix-gparse branch April 28, 2023 17:12
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.

Infinite loop on parse error in generics

4 participants