CI updates; cxxlib.h cleanups
This commit is contained in:
+3
-1
@@ -128,8 +128,10 @@ forceinline void ptr_check_no_overlap(const void *a, size_t a_size, const void *
|
||||
// invalidate and poison a pointer: point to a non-null invalid address
|
||||
// - resulting pointer should crash on dereference
|
||||
// - this should be efficient, so no mmap() guard page etc.
|
||||
// - this should play nice with runtime checkers like ASAN, MSAN, valgrind, etc.
|
||||
// - this should play nice with runtime checkers like ASAN, MSAN, UBSAN, valgrind, etc.
|
||||
// - this should play nice with static analyzers like clang-tidy etc.
|
||||
// NOTE: this is clearly UB (Undefined Behaviour), and stricter compilers or
|
||||
// architectures may need a more advanced/costly implementation in the future
|
||||
template <class T>
|
||||
inline void ptr_invalidate_and_poison(T *(&ptr)) noexcept {
|
||||
ptr = (T *) (void *) 251; // 0x000000fb // NOLINT(performance-no-int-to-ptr)
|
||||
|
||||
Reference in New Issue
Block a user