mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:17:35 +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:
parent
6582e34bbb
commit
e61d22b5b6
1 changed files with 2 additions and 1 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue