mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 18:02:05 -05:00
LibJS: Null-check current executable in VM::dump_backtrace()
If there is no current executable (because we're in a native function call), we shouldn't try to dereference it.
This commit is contained in:
parent
802af5ad9d
commit
2aab56bf71
1 changed files with 1 additions and 1 deletions
|
@ -423,7 +423,7 @@ void VM::dump_backtrace() const
|
|||
{
|
||||
for (ssize_t i = m_execution_context_stack.size() - 1; i >= 0; --i) {
|
||||
auto& frame = m_execution_context_stack[i];
|
||||
if (frame->program_counter.has_value()) {
|
||||
if (frame->executable && frame->program_counter.has_value()) {
|
||||
auto source_range = frame->executable->source_range_at(frame->program_counter.value()).realize();
|
||||
dbgln("-> {} @ {}:{},{}", frame->function_name ? frame->function_name->utf8_string() : ""_string, source_range.filename(), source_range.start.line, source_range.start.column);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Reference in a new issue