<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - llvm-objdump crash when disassemble a webassembly file which incudling bytecode "unreachable""
   href="https://bugs.llvm.org/show_bug.cgi?id=50312">50312</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>llvm-objdump crash when disassemble a webassembly file which incudling bytecode "unreachable"
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>tools
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>11.0
          </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>TableGen
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>jie.he.cn@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=24852" name="attach_24852" title="the wasm file causes llvm-objdump crash.">attachment 24852</a> <a href="attachment.cgi?id=24852&action=edit" title="the wasm file causes llvm-objdump crash.">[details]</a></span>
the wasm file causes llvm-objdump crash.

I have a wasm file, built from C code with option "-g".
To dump the bytecode, I launchs the llvm-objdump, but it gets crash.

enter the llvm-objdump code, find the crash caused by an assertion when print
the instruction "unreachable", the wrong index to access opinfo0 couldn't get
the instruction asm string.

we know, these data structures related to ISA are generated by llvm-tablegen,
thus, I track the corresponding code and td file, find that the pseudo
instructions in webassembly*.td have opcode value 0, they often occupy the
position the instruction "unreachable" should take, because the opcode of
"unreachable" is also 0.

so that, I tried to modify them to -1, and add isPseudo = 1 for some pseudo
instructions, rebuild the llvm, seems llvm-objdump works well.</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>