for (i = 0; i < nops; i++)
{
int addressp;
- rtx op = operands[oporder[i]];
+ int opnum = oporder[i];
+ /* Skip invalid ops. */
+ if (opnum == MAX_RECOG_OPERANDS)
+ continue;
+ rtx op = operands[opnum];
tree expr = get_mem_expr_from_op (op, &addressp);
fprintf (asm_out_file, "%c%s",
#ifdef ASSEMBLER_DIALECT
int dialect = 0;
#endif
- int oporder[MAX_RECOG_OPERANDS];
- char opoutput[MAX_RECOG_OPERANDS];
+ int oporder[MAX_RECOG_OPERANDS+1];
+ char opoutput[MAX_RECOG_OPERANDS+1];
int ops = 0;
/* An insn may return a null string template
output_operand_lossage ("operand number missing "
"after %%-letter");
else if (this_is_asm_operands && opnum >= insn_noperands)
- output_operand_lossage ("operand number out of range");
+ {
+ /* Force the opnum in bounds to a bogus location. */
+ opnum = MAX_RECOG_OPERANDS;
+ output_operand_lossage ("operand number out of range");
+ }
else if (letter == 'l')
output_asm_label (operands[opnum]);
else if (letter == 'a')
opnum = strtoul (p, &endptr, 10);
if (this_is_asm_operands && opnum >= insn_noperands)
- output_operand_lossage ("operand number out of range");
+ {
+ /* Force the opnum in bounds to a bogus location. */
+ opnum = MAX_RECOG_OPERANDS;
+ output_operand_lossage ("operand number out of range");
+ }
else
output_operand (operands[opnum], 0);