mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 21:59:07 +00: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
Notes:
sideshowbarker
2024-07-17 06:09:44 +09:00
Author: https://github.com/awesomekling
Commit: 2aab56bf71
Pull-request: https://github.com/SerenityOS/serenity/pull/24461
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
Add a link
Reference in a new issue