mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 12:17:35 +00:00
AK: Only try and get the Processor::current_id when it was initialized
This caused a null pointer dereference on early boot, since the gs_base was not set yet.
This commit is contained in:
parent
bc7b0a8986
commit
18d2a74e62
1 changed files with 8 additions and 4 deletions
|
@ -787,11 +787,15 @@ void vdbgln(StringView fmtstr, TypeErasedFormatParams& params)
|
||||||
|
|
||||||
#ifdef __serenity__
|
#ifdef __serenity__
|
||||||
# ifdef KERNEL
|
# ifdef KERNEL
|
||||||
if (Kernel::Processor::is_initialized() && Kernel::Thread::current()) {
|
if (Kernel::Processor::is_initialized()) {
|
||||||
auto& thread = *Kernel::Thread::current();
|
if (Kernel::Thread::current()) {
|
||||||
builder.appendff("\033[34;1m[#{} {}({}:{})]\033[0m: ", Kernel::Processor::current_id(), thread.process().name(), thread.pid().value(), thread.tid().value());
|
auto& thread = *Kernel::Thread::current();
|
||||||
|
builder.appendff("\033[34;1m[#{} {}({}:{})]\033[0m: ", Kernel::Processor::current_id(), thread.process().name(), thread.pid().value(), thread.tid().value());
|
||||||
|
} else {
|
||||||
|
builder.appendff("\033[34;1m[#{} Kernel]\033[0m: ", Kernel::Processor::current_id());
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
builder.appendff("\033[34;1m[#{} Kernel]\033[0m: ", Kernel::Processor::current_id());
|
builder.appendff("\033[34;1m[Kernel]\033[0m: ");
|
||||||
}
|
}
|
||||||
# else
|
# else
|
||||||
static TriState got_process_name = TriState::Unknown;
|
static TriState got_process_name = TriState::Unknown;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue