• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

Révision4c0ca98e58fc409c93b41bb6c42f3e873db47725 (tree)
l'heure2016-03-18 23:46:42
AuteurNick Clifton <nickc@redh...>
CommiterNick Clifton

Message de Log

Fix code to check for illegal element numbers when accessing AArch64 vector registers in AArch64 sim.

* cpustate.c (GET_VEC_ELEMENT): Fix off by one error checking
for an invalid element index.
(SET_VEC_ELEMENT): Likewise.

Change Summary

Modification

--- a/sim/aarch64/ChangeLog
+++ b/sim/aarch64/ChangeLog
@@ -4,6 +4,10 @@
44 Print hex equivalents of floats and doubles.
55 Check element number against array size when accessing vector
66 registers.
7+ (GET_VEC_ELEMENT): Fix off by one error checking for an invalid
8+ element index.
9+ (SET_VEC_ELEMENT): Likewise.
10+
711 * memory.c: Trace memory reads when --trace-memory is enabled.
812 Remove float and double load and store functions.
913 * memory.h (aarch64_get_mem_float): Delete prototype.
--- 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)
345345 #define GET_VEC_ELEMENT(REG, ELEMENT, FIELD) \
346346 do \
347347 { \
348- if (element > ARRAY_SIZE (cpu->fr[0].FIELD)) \
348+ if (element >= ARRAY_SIZE (cpu->fr[0].FIELD)) \
349349 { \
350350 TRACE_REGISTER (cpu, \
351351 "Internal SIM error: invalid element number: %d ",\
@@ -421,7 +421,7 @@ aarch64_get_vec_double (sim_cpu *cpu, VReg reg, unsigned element)
421421 #define SET_VEC_ELEMENT(REG, ELEMENT, VAL, FIELD, PRINTER) \
422422 do \
423423 { \
424- if (ELEMENT > ARRAY_SIZE (cpu->fr[0].FIELD)) \
424+ if (ELEMENT >= ARRAY_SIZE (cpu->fr[0].FIELD)) \
425425 { \
426426 TRACE_REGISTER (cpu, \
427427 "Internal SIM error: invalid element number: %d ",\