OSDN Git Service

* eval.c (evaluate_subexp_standard): Assert that there is at
authordrow <drow>
Tue, 4 Nov 2008 15:32:53 +0000 (15:32 +0000)
committerdrow <drow>
Tue, 4 Nov 2008 15:32:53 +0000 (15:32 +0000)
least one array dimension.

gdb/ChangeLog
gdb/eval.c

index 1c7b03c..45bbb12 100644 (file)
@@ -1,3 +1,8 @@
+2008-11-04  Daniel Jacobowitz  <dan@codesourcery.com>
+
+       * eval.c (evaluate_subexp_standard): Assert that there is at
+       least one array dimension.
+
 2008-11-03  Vladimir Prus  <vladimir@codesourcery.com>
 
        Make attach_command exception-safe
index 4394aa1..ccb6b74 100644 (file)
@@ -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. */