From 46e248fb7fe7af696f5bd331f1b981cfe2ffca76 Mon Sep 17 00:00:00 2001 From: liushuyu Date: Tue, 7 Jun 2022 00:57:43 -0600 Subject: rust/lex: skip broken string expression ... ... when the matching quote is not found on the same line this could unstuck the string parser when the parser could not advance the parsing position --- gcc/rust/parse/rust-parse-impl.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gcc/rust/parse/rust-parse-impl.h') diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h index dfd393e..0fc1c1f 100644 --- a/gcc/rust/parse/rust-parse-impl.h +++ b/gcc/rust/parse/rust-parse-impl.h @@ -914,7 +914,8 @@ Parser::parse_delim_token_tree () // repeat loop until finding the matching delimiter t = lexer.peek_token (); - while (!token_id_matches_delims (t->get_id (), delim_type)) + while (!token_id_matches_delims (t->get_id (), delim_type) + && t->get_id () != END_OF_FILE) { std::unique_ptr tok_tree = parse_token_tree (); -- cgit v1.1