mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +00:00
AK: Use explode_byte for pointer sanitization
This commit is contained in:
parent
b30b7de2d2
commit
607bddac96
Notes:
sideshowbarker
2024-07-18 05:21:02 +09:00
Author: https://github.com/Hendiadyoin1 Commit: https://github.com/SerenityOS/serenity/commit/607bddac960 Pull-request: https://github.com/SerenityOS/serenity/pull/9573
4 changed files with 4 additions and 16 deletions
|
@ -51,10 +51,7 @@ public:
|
|||
{
|
||||
clear();
|
||||
#ifdef SANITIZE_PTRS
|
||||
if constexpr (sizeof(T*) == 8)
|
||||
m_ptr = (T*)(0xe3e3e3e3e3e3e3e3);
|
||||
else
|
||||
m_ptr = (T*)(0xe3e3e3e3);
|
||||
m_ptr = (T*)(explode_byte(0xe3));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -95,10 +95,7 @@ public:
|
|||
{
|
||||
assign(nullptr);
|
||||
#ifdef SANITIZE_PTRS
|
||||
if constexpr (sizeof(T*) == 8)
|
||||
m_bits.store(0xb0b0b0b0b0b0b0b0, AK::MemoryOrder::memory_order_relaxed);
|
||||
else
|
||||
m_bits.store(0xb0b0b0b0, AK::MemoryOrder::memory_order_relaxed);
|
||||
m_bits.store(explode_byte(0xb0), AK::MemoryOrder::memory_order_relaxed);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -43,10 +43,7 @@ public:
|
|||
{
|
||||
clear();
|
||||
#ifdef SANITIZE_PTRS
|
||||
if constexpr (sizeof(T*) == 8)
|
||||
m_ptr = (T*)(0xe1e1e1e1e1e1e1e1);
|
||||
else
|
||||
m_ptr = (T*)(0xe1e1e1e1);
|
||||
m_ptr = (T*)(explode_byte(0xe1));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -182,10 +182,7 @@ public:
|
|||
{
|
||||
clear();
|
||||
#ifdef SANITIZE_PTRS
|
||||
if constexpr (sizeof(T*) == 8)
|
||||
m_bits.store(0xe0e0e0e0e0e0e0e0, AK::MemoryOrder::memory_order_relaxed);
|
||||
else
|
||||
m_bits.store(0xe0e0e0e0, AK::MemoryOrder::memory_order_relaxed);
|
||||
m_bits.store(explode_byte(0xe0), AK::MemoryOrder::memory_order_relaxed);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue