This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Commit: AArch64 sim: Fix off by one error checking for invalid vector array element
- From: Andreas Schwab <schwab at linux-m68k dot org>
- To: Nick Clifton <nickc at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 18 Mar 2016 15:54:23 +0100
- Subject: Re: Commit: AArch64 sim: Fix off by one error checking for invalid vector array element
- Authentication-results: sourceware.org; auth=none
- References: <87fuvnu9q7 dot fsf at redhat dot com>
Nick Clifton <nickc@redhat.com> writes:
> diff --git a/sim/aarch64/cpustate.c b/sim/aarch64/cpustate.c
> index 86b1b15..19f485e 100644
> --- a/sim/aarch64/cpustate.c
> +++ b/sim/aarch64/cpustate.c
> @@ -345,7 +345,7 @@ aarch64_set_FP_long_double (sim_cpu *cpu, VReg reg, FRegister a)
> #define GET_VEC_ELEMENT(REG, ELEMENT, FIELD) \
> do \
> { \
> - if (element > ARRAY_SIZE (cpu->fr[0].FIELD)) \
> + if (element >= ARRAY_SIZE (cpu->fr[0].FIELD)) \
s/element/ELEMENT/
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."