This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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]

[PATCH] fix upper bound of op_rank[]


With the O_md* range at some point in the past having got extended from
16 to 32 elements, the op_rank array was no longer large enough to hold
entries for all valid O_* values, representing a latent bug. Specify
the array size explicitly, and remove the pointless initializers for
O_md*.

gas/
2009-07-24  Jan Beulich  <jbeulich@novell.com>

	* expr.c (op_rank): Specify size. Remove O_md* initializers.

--- 2009-07-24/gas/expr.c	2009-07-03 10:05:26.000000000 +0200
+++ 2009-07-24/gas/expr.c	2009-07-24 10:38:11.000000000 +0200
@@ -1486,7 +1486,7 @@ static const operatorT op_encoding[256] 
    7	* / % << >>
    8	unary - unary ~
 */
-static operator_rankT op_rank[] = {
+static operator_rankT op_rank[O_max] = {
   0,	/* O_illegal */
   0,	/* O_absent */
   0,	/* O_constant */
@@ -1517,22 +1517,6 @@ static operator_rankT op_rank[] = {
   3,	/* O_logical_and */
   2,	/* O_logical_or */
   1,	/* O_index */
-  0,	/* O_md1 */
-  0,	/* O_md2 */
-  0,	/* O_md3 */
-  0,	/* O_md4 */
-  0,	/* O_md5 */
-  0,	/* O_md6 */
-  0,	/* O_md7 */
-  0,	/* O_md8 */
-  0,	/* O_md9 */
-  0,	/* O_md10 */
-  0,	/* O_md11 */
-  0,	/* O_md12 */
-  0,	/* O_md13 */
-  0,	/* O_md14 */
-  0,	/* O_md15 */
-  0,	/* O_md16 */
 };
 
 /* Unfortunately, in MRI mode for the m68k, multiplication and




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