diff options
author | Alan Modra <amodra@gmail.com> | 2020-08-29 11:10:54 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2020-08-29 13:17:57 +0930 |
commit | 0c0577f6a8498707a34cf21e4d1bc3357982c802 (patch) | |
tree | c52f88ef57cd0c7ceddb7c667cbc7c8195dd04a2 /opcodes | |
parent | 8a267ea84798eb4e6547c8ff2617d2377d83c118 (diff) | |
download | fsf-binutils-gdb-0c0577f6a8498707a34cf21e4d1bc3357982c802.zip fsf-binutils-gdb-0c0577f6a8498707a34cf21e4d1bc3357982c802.tar.gz fsf-binutils-gdb-0c0577f6a8498707a34cf21e4d1bc3357982c802.tar.bz2 |
PR26446 UBSAN: tc-csky.c:2618,4022 index out of bounds
PR 26446
* csky-opc.h (MAX_OPRND_NUM): Define to 5.
(union csky_operand): Use MAX_OPRND_NUM to size oprnds array.
Diffstat (limited to 'opcodes')
-rw-r--r-- | opcodes/ChangeLog | 6 | ||||
-rw-r--r-- | opcodes/csky-opc.h | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 6e7b8f4..4c1e08d 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,9 @@ +2020-08-29 Alan Modra <amodra@gmail.com> + + PR 26446 + * csky-opc.h (MAX_OPRND_NUM): Define to 5. + (union csky_operand): Use MAX_OPRND_NUM to size oprnds array. + 2020-08-28 Alan Modra <amodra@gmail.com> PR 26449 diff --git a/opcodes/csky-opc.h b/opcodes/csky-opc.h index 95df44d..0a0b138 100644 --- a/opcodes/csky-opc.h +++ b/opcodes/csky-opc.h @@ -22,7 +22,7 @@ #include "opcode/csky.h" #define OP_TABLE_NUM 2 -#define MAX_OPRND_NUM 4 +#define MAX_OPRND_NUM 5 enum operand_type { @@ -222,7 +222,7 @@ struct soperand union csky_operand { - struct operand oprnds[5]; + struct operand oprnds[MAX_OPRND_NUM]; struct suboperand1 { struct operand oprnd; |