PR26446 UBSAN: tc-csky.c:2618,4022 index out of bounds

Alan Modra amodra@gmail.com
Sat Aug 29 04:24:31 GMT 2020


gas and opcodes were out of sync.

	PR 26446
	* csky-opc.h (MAX_OPRND_NUM): Define to 5.
	(union csky_operand): Use MAX_OPRND_NUM to size oprnds array.

diff --git a/opcodes/csky-opc.h b/opcodes/csky-opc.h
index 95df44dad3..0a0b138fac 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;

-- 
Alan Modra
Australia Development Lab, IBM


More information about the Binutils mailing list