From: Daniel Jacobowitz Date: Tue, 4 Nov 2008 15:32:54 +0000 (+0000) Subject: * eval.c (evaluate_subexp_standard): Assert that there is at X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1c9f699cd9c816946535115db84ec0d0ce6bf330;p=binutils-gdb.git * eval.c (evaluate_subexp_standard): Assert that there is at least one array dimension. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 1c7b03cef2a..45bbb122ecc 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2008-11-04 Daniel Jacobowitz + + * eval.c (evaluate_subexp_standard): Assert that there is at + least one array dimension. + 2008-11-03 Vladimir Prus Make attach_command exception-safe diff --git a/gdb/eval.c b/gdb/eval.c index 4394aa19bd4..ccb6b742b61 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. */