From 8e2d0c8d5cbbc8a2773c187090f2b652157fd5f5 Mon Sep 17 00:00:00 2001 From: Daniel Bertalan Date: Sat, 4 Dec 2021 09:08:27 +0100 Subject: [PATCH] Kernel: Do not return a null ref in `Processor::current` on aarch64 Clang rejects binding a reference to a null pointer at compile-time. Let's just crash explicitly, instead of waiting for a null dereference to mess things up. --- Kernel/Arch/aarch64/Processor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kernel/Arch/aarch64/Processor.h b/Kernel/Arch/aarch64/Processor.h index 4f053d06379..3992cb252ff 100644 --- a/Kernel/Arch/aarch64/Processor.h +++ b/Kernel/Arch/aarch64/Processor.h @@ -58,7 +58,7 @@ public: return 0; } - ALWAYS_INLINE static Processor& current() { return *((Processor*)0); } + ALWAYS_INLINE static Processor& current() { VERIFY_NOT_REACHED(); } static void deferred_call_queue(Function /* callback */) { }