浏览代码

LibX86: Fix duplicate '+' in SIB byte disassembly

For SIB bytes with base but no index, we were emitting two '+' chars
which looked very off.
Andreas Kling 5 年之前
父节点
当前提交
8daddcfa0a
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      Libraries/LibX86/Instruction.cpp

+ 2 - 1
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);
     }