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

            Bug ID: 50312
           Summary: llvm-objdump crash when disassemble a webassembly file
                    which incudling bytecode "unreachable"
           Product: tools
           Version: 11.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: TableGen
          Assignee: unassignedb...@nondot.org
          Reporter: jie.he...@gmail.com
                CC: llvm-bugs@lists.llvm.org

Created attachment 24852
  --> https://bugs.llvm.org/attachment.cgi?id=24852&action=edit
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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to