diff options
author | Tom Tromey <tromey@adacore.com> | 2023-05-01 10:10:29 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2023-05-01 10:10:29 -0600 |
commit | 87c84f07a0a1b7e12b6a0c9b21cc0e021e460786 (patch) | |
tree | e6ad017a72b194b6f7ca6c03bc3a4db696f66dc7 /gdb/testsuite/gdb.rust/expr.exp | |
parent | c819a3380fc1b110b88bc6ab5ef9323dbe7d4753 (diff) | |
download | binutils-87c84f07a0a1b7e12b6a0c9b21cc0e021e460786.zip binutils-87c84f07a0a1b7e12b6a0c9b21cc0e021e460786.tar.gz binutils-87c84f07a0a1b7e12b6a0c9b21cc0e021e460786.tar.bz2 |
Fix crash in Rust expression parser
A user found that an array expression with just a single value (like
"[23]") caused the Rust expression parser to crash.
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30410
Diffstat (limited to 'gdb/testsuite/gdb.rust/expr.exp')
-rw-r--r-- | gdb/testsuite/gdb.rust/expr.exp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.rust/expr.exp b/gdb/testsuite/gdb.rust/expr.exp index 4a0a48a..908d1a3 100644 --- a/gdb/testsuite/gdb.rust/expr.exp +++ b/gdb/testsuite/gdb.rust/expr.exp @@ -113,6 +113,7 @@ gdb_test "ptype \[1,2,3,4\]" "type = \\\[i32; 4\\\]" gdb_test "print \[mut 1,2,3,4\]" " = \\\[1, 2, 3, 4\\\]" gdb_test "print \[1,2 3" "',' or ']' expected" gdb_test "print \[1 2" "',', ';', or ']' expected" +gdb_test "print \[23\]" " = \\\[23\\\]" gdb_test "print b\"hi rust\"" " = b\"hi rust\"" # This isn't rusty syntax yet, but that's another bug -- this is just |