[llvm-bugs] [Bug 41659] New: X86DisassemblerDecoder.cpp - readPrefixes - always true condition

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Apr 29 14:54:30 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=41659

            Bug ID: 41659
           Summary: X86DisassemblerDecoder.cpp - readPrefixes - always
                    true condition
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: llvm-dev at redking.me.uk
                CC: craig.topper at gmail.com, llvm-bugs at lists.llvm.org,
                    llvm-dev at redking.me.uk, spatel+llvm at rotateright.com
            Blocks: 41655

Reported in https://www.viva64.com/en/b/0629/

static int readPrefixes(struct InternalInstruction* insn) {
  ....
  uint8_t byte = 0;
  uint8_t nextByte;
  ....
  if (byte == 0xf3 && (nextByte == 0x88 || nextByte == 0x89 ||
                       nextByte == 0xc6 || nextByte == 0xc7)) {
    insn->xAcquireRelease = true;
    if (nextByte != 0x90) // PAUSE instruction support             // <=
      break;
  }
  ....
}

The (nextByte != 0x90) test is always true - should we just break here or is
there a logic error?


Referenced Bugs:

https://bugs.llvm.org/show_bug.cgi?id=41655
[Bug 41655] Finding Bugs in LLVM 8 with PVS-Studio
-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190429/5ccb3b5f/attachment.html>


More information about the llvm-bugs mailing list