Преглед на файлове

[S390] disassembler: fix output for insns with 6 operands.

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>
Martin Schwidefsky преди 17 години
родител
ревизия
74ccbdc226
променени са 1 файла, в които са добавени 3 реда и са изтрити 1 реда
  1. 3 1
      arch/s390/kernel/dis.c

+ 3 - 1
arch/s390/kernel/dis.c

@@ -1162,6 +1162,7 @@ static int print_insn(char *buffer, unsigned char *code, unsigned long addr)
 	unsigned int value;
 	unsigned int value;
 	char separator;
 	char separator;
 	char *ptr;
 	char *ptr;
+	int i;
 
 
 	ptr = buffer;
 	ptr = buffer;
 	insn = find_insn(code);
 	insn = find_insn(code);
@@ -1169,7 +1170,8 @@ static int print_insn(char *buffer, unsigned char *code, unsigned long addr)
 		ptr += sprintf(ptr, "%.5s\t", insn->name);
 		ptr += sprintf(ptr, "%.5s\t", insn->name);
 		/* Extract the operands. */
 		/* Extract the operands. */
 		separator = 0;
 		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;
 			operand = operands + *ops;
 			value = extract_operand(code, operand);
 			value = extract_operand(code, operand);
 			if ((operand->flags & OPERAND_INDEX)  && value == 0)
 			if ((operand->flags & OPERAND_INDEX)  && value == 0)