Skip to content

Commit 838331a

Browse files
authored
[BOLT] Set NOOP size only on X86 (NFC) (#71307)
Small fix, we have problems with noop size only on x86, no reason to do it on other platforms.
1 parent ed350bb commit 838331a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bolt/lib/Core/BinaryFunction.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1375,8 +1375,8 @@ bool BinaryFunction::disassemble() {
13751375
if (BC.keepOffsetForInstruction(Instruction))
13761376
MIB->setOffset(Instruction, static_cast<uint32_t>(Offset));
13771377

1378-
if (BC.MIB->isNoop(Instruction)) {
1379-
// NOTE: disassembly loses the correct size information for noops.
1378+
if (BC.isX86() && BC.MIB->isNoop(Instruction)) {
1379+
// NOTE: disassembly loses the correct size information for noops on x86.
13801380
// E.g. nopw 0x0(%rax,%rax,1) is 9 bytes, but re-encoded it's only
13811381
// 5 bytes. Preserve the size info using annotations.
13821382
MIB->addAnnotation(Instruction, "Size", static_cast<uint32_t>(Size));

0 commit comments

Comments
 (0)