Second part of the && is already guaranteed in the "regnum < num_regs"
due to comparison above.
2017-01-27 Walfred Tedeschi <walfred.tedeschi@intel.com>
* amd64-nat.c (amd64_native_gregset_reg_offset): Simplify logic
that checks validity of a register number.
+2017-01-27 Walfred Tedeschi <walfred.tedeschi@intel.com>
+
+ * amd64-nat.c (amd64_native_gregset_reg_offset): Simplify logic
+ that checks validity of a register number.
+
2017-01-27 Kees Cook <keescook@google.com>
* gdb/arm-linux-nat.c (arm_linux_fetch_inferior_registers): Call
if (num_regs > gdbarch_num_regs (gdbarch))
num_regs = gdbarch_num_regs (gdbarch);
- if (regnum < num_regs && regnum < gdbarch_num_regs (gdbarch))
- return reg_offset[regnum];
+ if (regnum >= num_regs)
+ return -1;
- return -1;
+ return reg_offset[regnum];
}
/* Return whether the native general-purpose register set supplies