mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 13:36:13 +03: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: https://github.com/SerenityOS/serenity/commit/2aab56bf71 Pull-request: https://github.com/SerenityOS/serenity/pull/24461
@ -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…
Reference in New Issue
Block a user