*** binutils-2.8.1/gas/expr.c Mon May 26 10:32:47 1997 --- binutils-2.8.1/gas/expr.c.s-max Sat Dec 5 01:17:32 1998 *************** *** 1293,1298 **** --- 1293,1310 ---- } } + /* Return the encoding for the input byte if and only if the byte is + in range. This is a utility fn for operator(). */ + static inline operatorT + get_op_encoding(int c) + { + if ((c < 0) || (c > (sizeof(op_encoding) / sizeof(op_encoding[0])))) + as_fatal ("expr.c(get_op_encoding): invalid input character 0x%x.", + c & 0xff); + + return op_encoding[c]; + } + /* Return the encoding for the operator at INPUT_LINE_POINTER. Advance INPUT_LINE_POINTER to the last character in the operator (i.e., don't change it for a single character operator). */ *************** *** 1308,1320 **** switch (c) { default: ! return op_encoding[c]; case '<': switch (input_line_pointer[1]) { default: ! return op_encoding[c]; case '<': ret = O_left_shift; break; --- 1320,1332 ---- switch (c) { default: ! return get_op_encoding(c); case '<': switch (input_line_pointer[1]) { default: ! return get_op_encoding(c); case '<': ret = O_left_shift; break; *************** *** 1332,1338 **** switch (input_line_pointer[1]) { default: ! return op_encoding[c]; case '>': ret = O_right_shift; break; --- 1344,1350 ---- switch (input_line_pointer[1]) { default: ! return get_op_encoding(c); case '>': ret = O_right_shift; break; *************** *** 1349,1369 **** { if (flag_m68k_mri) return O_bit_inclusive_or; ! return op_encoding[c]; } ++input_line_pointer; return O_bit_exclusive_or; case '|': if (input_line_pointer[1] != '|') ! return op_encoding[c]; ++input_line_pointer; return O_logical_or; case '&': if (input_line_pointer[1] != '&') ! return op_encoding[c]; ++input_line_pointer; return O_logical_and; --- 1361,1381 ---- { if (flag_m68k_mri) return O_bit_inclusive_or; ! return get_op_encoding(c); } ++input_line_pointer; return O_bit_exclusive_or; case '|': if (input_line_pointer[1] != '|') ! return get_op_encoding(c); ++input_line_pointer; return O_logical_or; case '&': if (input_line_pointer[1] != '&') ! return get_op_encoding(c); ++input_line_pointer; return O_logical_and;