Skip to content

Commit

Permalink
[S390] disassembler: fix output for insns with 6 operands.
Browse files Browse the repository at this point in the history
The termination condition of the loop that prints the operands of
an instruction doesn't stop after the maximum of 6 operands.
It continues with the operands of the next instruction format
instead which create really long lines.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
  • Loading branch information
Martin Schwidefsky committed Oct 12, 2007
1 parent 076fc80 commit 74ccbdc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion arch/s390/kernel/dis.c
Original file line number Diff line number Diff line change
Expand Up @@ -1162,14 +1162,16 @@ static int print_insn(char *buffer, unsigned char *code, unsigned long addr)
unsigned int value;
char separator;
char *ptr;
int i;

ptr = buffer;
insn = find_insn(code);
if (insn) {
ptr += sprintf(ptr, "%.5s\t", insn->name);
/* Extract the operands. */
separator = 0;
for (ops = formats[insn->format] + 1; *ops != 0; ops++) {
for (ops = formats[insn->format] + 1, i = 0;
*ops != 0 && i < 6; ops++, i++) {
operand = operands + *ops;
value = extract_operand(code, operand);
if ((operand->flags & OPERAND_INDEX) && value == 0)
Expand Down

0 comments on commit 74ccbdc

Please sign in to comment.