diff options
author | Tom Tromey <tromey@adacore.com> | 2022-12-06 07:41:52 -0700 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2022-12-06 07:41:52 -0700 |
commit | e03698c1227bc18835cc2e4a9146a8369635e119 (patch) | |
tree | ee736b40573cf42d8379f677776ca385af74f553 /gdb/rust-parse.c | |
parent | 83f18e5ebe627163f744215d3760a8eaacee6ec1 (diff) | |
download | gdb-e03698c1227bc18835cc2e4a9146a8369635e119.zip gdb-e03698c1227bc18835cc2e4a9146a8369635e119.tar.gz gdb-e03698c1227bc18835cc2e4a9146a8369635e119.tar.bz2 |
Fix operator precedence bug in Rust parser
PR rust/29859 points out an operator precedence bug in the Rust
parser. This patch fixes it and adds a regression test.
Diffstat (limited to 'gdb/rust-parse.c')
-rw-r--r-- | gdb/rust-parse.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/rust-parse.c b/gdb/rust-parse.c index f5eb63e..3379272 100644 --- a/gdb/rust-parse.c +++ b/gdb/rust-parse.c @@ -1398,7 +1398,7 @@ rust_parser::parse_binop (bool required) break; } - while (precedence < operator_stack.back ().precedence + while (precedence <= operator_stack.back ().precedence && operator_stack.size () > 1) { rustop_item rhs = std::move (operator_stack.back ()); |