diff options
author | Pedro Alves <pedro@codesourcery.com> | 2010-02-11 23:03:21 +0000 |
---|---|---|
committer | Pedro Alves <pedro@codesourcery.com> | 2010-02-11 23:03:21 +0000 |
commit | 415267d28ef90ab39995d6659bf7a0e3d925201e (patch) | |
tree | 4199731f36701f90df4ba1f72e8beef24eba8ec9 /gdb/ax-gdb.c | |
parent | 33e6eadefb7cc3b47dec9e2049c4121cf69e0a60 (diff) | |
download | gdb-415267d28ef90ab39995d6659bf7a0e3d925201e.tar.gz |
* ax-gdb.c (gen_exp_binop_rest) [BINOP_SUBSCRIPT]: Error out if
the offset value isn't of integral type.
Diffstat (limited to 'gdb/ax-gdb.c')
-rw-r--r-- | gdb/ax-gdb.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c index 75aa7ca62b2..3e151deccfb 100644 --- a/gdb/ax-gdb.c +++ b/gdb/ax-gdb.c @@ -1910,6 +1910,9 @@ cannot subscript requested type: cannot call user defined functions")); } } + if (!is_integral_type (value2->type)) + error (_("Argument to arithmetic operation not a number or boolean.")); + gen_ptradd (ax, value, value1, value2); gen_deref (ax, value); break; |