mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 10:22:05 -05:00
LibJS/JIT: Don't crash when dissassembling an empty basic block
This commit is contained in:
parent
e1e7e696ac
commit
7826c006c1
1 changed files with 5 additions and 3 deletions
|
@ -118,9 +118,11 @@ void NativeExecutable::dump_disassembly([[maybe_unused]] Bytecode::Executable co
|
|||
if (mapping->bytecode_offset == 0)
|
||||
dbgln("\nBlock {}:", mapping->block_index + 1);
|
||||
|
||||
VERIFY(mapping->bytecode_offset < block.size());
|
||||
auto const& instruction = *reinterpret_cast<Bytecode::Instruction const*>(block.data() + mapping->bytecode_offset);
|
||||
dbgln("{}:{:x} {}:", mapping->block_index + 1, mapping->bytecode_offset, instruction.to_deprecated_string(executable));
|
||||
if (block.size() != 0) {
|
||||
VERIFY(mapping->bytecode_offset < block.size());
|
||||
auto const& instruction = *reinterpret_cast<Bytecode::Instruction const*>(block.data() + mapping->bytecode_offset);
|
||||
dbgln("{}:{:x} {}:", mapping->block_index + 1, mapping->bytecode_offset, instruction.to_deprecated_string(executable));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue