aboutsummaryrefslogtreecommitdiff
path: root/gdb/eval.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2008-11-04 15:32:54 +0000
committerDaniel Jacobowitz <drow@false.org>2008-11-04 15:32:54 +0000
commit1c9f699cd9c816946535115db84ec0d0ce6bf330 (patch)
tree4fa8fb67e5fd0c39e5acdb53a44d4c0fdad3ccc9 /gdb/eval.c
parenta03db8620f06af1d4950135f9b1818452cbc0ed6 (diff)
downloadgdb-1c9f699cd9c816946535115db84ec0d0ce6bf330.zip
gdb-1c9f699cd9c816946535115db84ec0d0ce6bf330.tar.gz
gdb-1c9f699cd9c816946535115db84ec0d0ce6bf330.tar.bz2
* eval.c (evaluate_subexp_standard): Assert that there is at
least one array dimension.
Diffstat (limited to 'gdb/eval.c')
-rw-r--r--gdb/eval.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gdb/eval.c b/gdb/eval.c
index 4394aa1..ccb6b742 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -1976,6 +1976,8 @@ evaluate_subexp_standard (struct type *expect_type,
if (nargs != ndimensions)
error (_("Wrong number of subscripts"));
+ gdb_assert (nargs > 0);
+
/* Now that we know we have a legal array subscript expression
let us actually find out where this element exists in the array. */