PR26460 UBSAN: tc-ia64.c:6107 index out of bounds

PR 26460
	* config/tc-ia64.c (parse_operands): Don't access past end of
	idesc->operands.
This commit is contained in:
Alan Modra
2020-08-28 23:09:29 +09:30
parent 07319accdf
commit ed2ed4dcf4
2 changed files with 10 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2020-08-28 Alan Modra <amodra@gmail.com>
PR 26460
* config/tc-ia64.c (parse_operands): Don't access past end of
idesc->operands.
2020-08-26 Mark Wielaard <mark@klomp.org>
* as.c (parse_args): Handle bad -gdwarf options.

View File

@ -6098,8 +6098,10 @@ parse_operands (struct ia64_opcode *idesc)
{
if (i < NELEMS (CURR_SLOT.opnd))
{
sep = parse_operand_maybe_eval (CURR_SLOT.opnd + i, '=',
idesc->operands[i]);
enum ia64_opnd op = IA64_OPND_NIL;
if (i < NELEMS (idesc->operands))
op = idesc->operands[i];
sep = parse_operand_maybe_eval (CURR_SLOT.opnd + i, '=', op);
if (CURR_SLOT.opnd[i].X_op == O_absent)
break;
}