[gcc r14-8527] gccrs: Fix error emission for self pointers
Arthur Cohen
cohenarthur@gcc.gnu.org
Tue Jan 30 11:57:00 GMT 2024
https://gcc.gnu.org/g:ca16a3ee232dac565cb18ea5e0b84c4ad54f727e
commit r14-8527-gca16a3ee232dac565cb18ea5e0b84c4ad54f727e
Author: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Date: Wed Nov 15 11:08:09 2023 +0100
gccrs: Fix error emission for self pointers
Self pointer checking loop condition was inverted, the latter was
therefore never executed.
gcc/rust/ChangeLog:
* parse/rust-parse-impl.h (Parser::parse_self_param): Fix the loop
exit condition.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Diff:
---
gcc/rust/parse/rust-parse-impl.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h
index 0ae89dc39074..1ebe1ed442c0 100644
--- a/gcc/rust/parse/rust-parse-impl.h
+++ b/gcc/rust/parse/rust-parse-impl.h
@@ -7129,7 +7129,7 @@ Parser<ManagedTokenSource>::parse_self_param ()
for (auto &s : ptrs)
{
size_t i = 0;
- for (i = 0; i > s.size (); i++)
+ for (i = 0; i < s.size (); i++)
if (lexer.peek_token (i)->get_id () != s[i])
break;
if (i == s.size ())
More information about the Gcc-cvs
mailing list