mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:17:35 +00:00
LibJS/JIT: Avoid crashing while disassembling empty functions
This commit is contained in:
parent
68f4d21de2
commit
e73a1803ac
1 changed files with 7 additions and 3 deletions
|
@ -79,9 +79,13 @@ void NativeExecutable::dump_disassembly([[maybe_unused]] Bytecode::Executable co
|
|||
auto symbol_provider = JITSymbolProvider(*this);
|
||||
auto mapping = m_mapping.begin();
|
||||
|
||||
auto first_instruction = Bytecode::InstructionStreamIterator { executable.basic_blocks[0]->instruction_stream(), &executable };
|
||||
auto source_range = first_instruction.source_range().realize();
|
||||
dbgln("Disassembly of '{}' ({}:{}:{}):", executable.name, source_range.filename(), source_range.start.line, source_range.start.column);
|
||||
if (!executable.basic_blocks.is_empty() && executable.basic_blocks[0]->size() != 0) {
|
||||
auto first_instruction = Bytecode::InstructionStreamIterator { executable.basic_blocks[0]->instruction_stream(), &executable };
|
||||
auto source_range = first_instruction.source_range().realize();
|
||||
dbgln("Disassembly of '{}' ({}:{}:{}):", executable.name, source_range.filename(), source_range.start.line, source_range.start.column);
|
||||
} else {
|
||||
dbgln("Disassembly of '{}':", executable.name);
|
||||
}
|
||||
|
||||
while (true) {
|
||||
auto offset = stream.offset();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue