Skip to content

Commit e9c5dd9

Browse files
kddnewtonmeta-codesync[bot]
authored andcommitted
Fix disassembling constant pool
Summary: When the disassembler hits the constant pool, right now it raises an exception. Instead, print out the invalid byte and continue on to avoid crashing the compiler. Reviewed By: alexmalyshev Differential Revision: D86229752 fbshipit-source-id: ef0c3e8bf1c4e80a54a468db69e576454c6b3300
1 parent aba77a0 commit e9c5dd9

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

cinderx/Jit/disassembler.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ void Disassembler::disassemble(std::ostream& os, size_t handle) {
124124
cs_malloc(handle), insn_deleter);
125125

126126
if (!cs_disasm_iter(handle, &code, &size, &address, insn.get())) {
127-
throw std::runtime_error{"Failed to disassemble instruction"};
127+
fmt::print(os, "RAW: 0x{:02x}", static_cast<unsigned char>(buf_[start_++]));
128+
return;
128129
}
129130

130131
fmt::print(os, "{} {}", insn->mnemonic, insn->op_str);

0 commit comments

Comments
 (0)