<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Disassembly asserts for certain invalid PowerPC instructions"
   href="https://llvm.org/bugs/show_bug.cgi?id=30507">30507</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Disassembly asserts for certain invalid PowerPC instructions
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>3.9
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Backend: PowerPC
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>njholcomb@wi.rr.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Calls to LLVMDisasmInstruction() with certain invalid PPC instructions fails
due to assertions instead of returning an error. Below are 4 asserts that were
hit, including example input bytes:

Input: fe 47 c0 0a 
llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp:256: void
llvm::PPCInstPrinter::printU1ImmOperand(const llvm::MCInst*, unsigned int,
llvm::raw_ostream&): Assertion `Value <= 1 && "Invalid u1imm argument!"'
failed.

Input: 12 d0 e2 0d 
llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp:277: void
llvm::PPCInstPrinter::printU4ImmOperand(const llvm::MCInst*, unsigned int,
llvm::raw_ostream&): Assertion `Value <= 15 && "Invalid u4imm argument!"'
failed.

Input: 7f 1f ce 5d 
llvm/lib/Target/PowerPC/Disassembler/PPCDisassembler.cpp:210: DecodeStatus
decodeRegisterClass(llvm::MCInst&, uint64_t, const unsigned int (&)[N]) [with
long unsigned int N = 8ul; DecodeStatus = llvm::MCDisassembler::DecodeStatus;
uint64_t = long unsigned int]: Assertion `RegNo < N && "Invalid register
number"' failed.

Input: 7c 96 36 1d 
llvm/include/llvm/MC/MCInst.h:75: int64_t llvm::MCOperand::getImm() const:
Assertion `isImm() && "This is not an immediate"' failed.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>