From: Pedro Alves Date: Thu, 11 Feb 2010 23:03:22 +0000 (+0000) Subject: * ax-gdb.c (gen_exp_binop_rest) [BINOP_SUBSCRIPT]: Error out if X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5d5b640e00fd8d48d15cd3b8118ca281055ada9b;p=binutils-gdb.git * ax-gdb.c (gen_exp_binop_rest) [BINOP_SUBSCRIPT]: Error out if the offset value isn't of integral type. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 17753a99d67..c26c0225274 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2010-02-11 Pedro Alves + + * ax-gdb.c (gen_exp_binop_rest) [BINOP_SUBSCRIPT]: Error out if + the offset value isn't of integral type. + 2010-02-11 Jan Kratochvil * breakpoint.c (delete_breakpoint) related_breakpoint != NULL>: 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;