1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 06:37:44 +00:00

Kernel: Prevent atomic read/write from failing on nullptr

Having this function return `nullptr` explicitly triggers the compiler's
inbuilt checker, as it knows the destination is null. Having this as a
static (scoped) variable for now circumvents this problem.
This commit is contained in:
Jesse Buhagiar 2022-10-17 23:00:48 +11:00 committed by Linus Groh
parent 6582e34bbb
commit e61d22b5b6

View file

@ -114,7 +114,8 @@ public:
// FIXME: Actually return the current thread once aarch64 supports threading. // FIXME: Actually return the current thread once aarch64 supports threading.
ALWAYS_INLINE static Thread* current_thread() ALWAYS_INLINE static Thread* current_thread()
{ {
return nullptr; static Thread* current_thread { nullptr };
return current_thread;
} }
ALWAYS_INLINE bool has_nx() const ALWAYS_INLINE bool has_nx() const