This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Commit: AArch64 sim: Fix off by one error checking for invalid vector array element


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."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]