File tree Expand file tree Collapse file tree 4 files changed +15
-1
lines changed
Expand file tree Collapse file tree 4 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 1818 build_type : Debug
1919 build_tool_options : -j 4
2020 analyzer : off
21- sanitizer : address
21+ sanitizer : address,undefined
2222 - os : macos-12
2323 build_type : Debug
2424 build_tool_options : -j 4
Original file line number Diff line number Diff line change 1818# define really_inline __forceinline
1919# define never_inline __declspec(noinline)
2020# define warn_unused_result
21+ # define no_sanitize_undefined
2122
2223# define likely (params ) (params)
2324# define unlikely (params ) (params)
4647# define warn_unused_result
4748# endif
4849
50+ # if zone_has_attribute (no_sanitize )
51+ // GCC 8.1 added the no_sanitize function attribute.
52+ # define no_sanitize_undefined __attribute__((no_sanitize("undefined")))
53+ # elif zone_has_attribute (no_sanitize_undefined )
54+ // GCC 4.9.0 added the UndefinedBehaviorSanitizer (ubsan) and the
55+ // no_sanitize_undefined function attribute.
56+ # define no_sanitize_undefined
57+ # else
58+ # define no_sanitize_undefined
59+ # endif
60+
4961# define likely (params ) __builtin_expect(!!(params), 1)
5062# define unlikely (params ) __builtin_expect(!!(params), 0)
5163#endif
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ static inline uint64_t count_ones(uint64_t bits) {
2121 return (uint64_t )_mm_popcnt_u64 (bits );
2222}
2323
24+ no_sanitize_undefined
2425static inline uint64_t trailing_zeroes (uint64_t bits ) {
2526 return (uint64_t )__builtin_ctzll (bits );
2627}
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ static inline uint64_t count_ones(uint64_t input_num) {
2020 return (uint64_t )_mm_popcnt_u64 (input_num );
2121}
2222
23+ no_sanitize_undefined
2324static inline uint64_t trailing_zeroes (uint64_t input_num ) {
2425 return (uint64_t )__builtin_ctzll (input_num );
2526}
You can’t perform that action at this time.
0 commit comments