mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +00:00
AK: Use __builtin_offsetof() + -Wno-invalid-offsetof to silence ASAN
ASAN was crying way too much when running the LibJS JIT since the old OFFSET_OF implementation was too wild for its liking. By turning off the invalid-offsetof warnings, we can use the offsetof builtin instead. However, I'm leaving this as a wrapper macro, since we may still want to do something different for other compilers.
This commit is contained in:
parent
1541942e10
commit
a6106ca221
Notes:
sideshowbarker
2024-07-17 18:49:10 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/a6106ca221 Pull-request: https://github.com/SerenityOS/serenity/pull/22041 Reviewed-by: https://github.com/skyrising
2 changed files with 3 additions and 1 deletions
|
@ -16,7 +16,7 @@
|
|||
|
||||
#include <AK/Assertions.h>
|
||||
|
||||
#define OFFSET_OF(class, member) (reinterpret_cast<ptrdiff_t>(&reinterpret_cast<class*>(0x1000)->member) - 0x1000)
|
||||
#define OFFSET_OF(class, member) __builtin_offsetof(class, member)
|
||||
|
||||
namespace AK {
|
||||
|
||||
|
|
|
@ -6,6 +6,8 @@ set(CMAKE_CXX_EXTENSIONS OFF)
|
|||
add_compile_options(-Wall)
|
||||
add_compile_options(-Wextra)
|
||||
|
||||
add_compile_options(-Wno-invalid-offsetof)
|
||||
|
||||
add_compile_options(-Wno-unknown-warning-option)
|
||||
add_compile_options(-Wno-unused-command-line-argument)
|
||||
|
||||
|
|
Loading…
Reference in a new issue