gdbserver/tracepoint: Add casts out of tpoint->handle
[deliverable/binutils-gdb.git] / gdb / findvar.c
index 0f46e53cd38a4e973f4199e161730a26f4063d1b..855947d682855cca3b5d1b0f2a2630c0a69a23e0 100644 (file)
@@ -927,6 +927,12 @@ address_from_register (int regnum, struct frame_info *frame)
   struct type *type = builtin_type (gdbarch)->builtin_data_ptr;
   struct value *value;
   CORE_ADDR result;
+  int regnum_max_excl = (gdbarch_num_regs (gdbarch)
+                        + gdbarch_num_pseudo_regs (gdbarch));
+
+  if (regnum < 0 || regnum >= regnum_max_excl)
+    error (_("Invalid register #%d, expecting 0 <= # < %d"), regnum,
+          regnum_max_excl);
 
   /* This routine may be called during early unwinding, at a time
      where the ID of FRAME is not yet known.  Calling value_from_register
This page took 0.024582 seconds and 4 git commands to generate.