* ax-gdb.c (gen_exp_binop_rest) [BINOP_SUBSCRIPT]: Error out if
authorPedro Alves <palves@redhat.com>
Thu, 11 Feb 2010 23:03:22 +0000 (23:03 +0000)
committerPedro Alves <palves@redhat.com>
Thu, 11 Feb 2010 23:03:22 +0000 (23:03 +0000)
the offset value isn't of integral type.

gdb/ChangeLog
gdb/ax-gdb.c

index 17753a99d67e8f5abcd18c4d0786aa2dd9c6ee50..c26c022527405ee2520e114f5ee6c3a5a8138828 100644 (file)
@@ -1,3 +1,8 @@
+2010-02-11  Pedro Alves  <pedro@codesourcery.com>
+
+       * 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  <jan.kratochvil@redhat.com>
 
        * breakpoint.c (delete_breakpoint) <bpt->related_breakpoint != NULL>:
index 75aa7ca62b2bfe3a14c334695949298babc5667d..3e151deccfbaf0c909656e3a4c53c8c1970ea9d7 100644 (file)
@@ -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;