Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

+3 -1
+3 -1
arch/s390/kernel/dis.c
··· 1162 1162 unsigned int value; 1163 1163 char separator; 1164 1164 char *ptr; 1165 + int i; 1165 1166 1166 1167 ptr = buffer; 1167 1168 insn = find_insn(code); ··· 1170 1169 ptr += sprintf(ptr, "%.5s\t", insn->name); 1171 1170 /* Extract the operands. */ 1172 1171 separator = 0; 1173 - for (ops = formats[insn->format] + 1; *ops != 0; ops++) { 1172 + for (ops = formats[insn->format] + 1, i = 0; 1173 + *ops != 0 && i < 6; ops++, i++) { 1174 1174 operand = operands + *ops; 1175 1175 value = extract_operand(code, operand); 1176 1176 if ((operand->flags & OPERAND_INDEX) && value == 0)