From 8daddcfa0aff457266202a8741a5ea93a545172f Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 11 Apr 2020 23:09:54 +0200 Subject: [PATCH] LibX86: Fix duplicate '+' in SIB byte disassembly For SIB bytes with base but no index, we were emitting two '+' chars which looked very off. --- Libraries/LibX86/Instruction.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Libraries/LibX86/Instruction.cpp b/Libraries/LibX86/Instruction.cpp index 530d347571..eb5eff8d4d 100644 --- a/Libraries/LibX86/Instruction.cpp +++ b/Libraries/LibX86/Instruction.cpp @@ -1170,7 +1170,8 @@ static String sib_to_string(u8 rm, u8 sib) builder.append(scale); } else { builder.append(base); - builder.append('+'); + if (!base.is_empty() && !index.is_empty()) + builder.append('+'); builder.append(index); builder.append(scale); }