mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-27 03:37:53 +00:00
ProfileViewer: Don't crash when we can't disassemble something
This commit is contained in:
@@ -55,9 +55,15 @@ DisassemblyModel::DisassemblyModel(Profile& profile, ProfileNode& node)
|
||||
, m_node(node)
|
||||
{
|
||||
m_file = make<MappedFile>(profile.executable_path());
|
||||
|
||||
if (!m_file->is_valid())
|
||||
return;
|
||||
|
||||
auto elf_loader = make<ELF::Loader>((const u8*)m_file->data(), m_file->size());
|
||||
|
||||
auto symbol = elf_loader->find_symbol(node.address());
|
||||
if (!symbol.has_value())
|
||||
return;
|
||||
ASSERT(symbol.has_value());
|
||||
|
||||
auto view = symbol.value().raw_data();
|
||||
|
||||
Reference in New Issue
Block a user