Commit e5a2712 1 parent 75269fb commit e5a2712 Copy full SHA for e5a2712
File tree 4 files changed +15
-1
lines changed
4 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 18
18
build_type : Debug
19
19
build_tool_options : -j 4
20
20
analyzer : off
21
- sanitizer : address
21
+ sanitizer : address,undefined
22
22
- os : macos-12
23
23
build_type : Debug
24
24
build_tool_options : -j 4
Original file line number Diff line number Diff line change 18
18
# define really_inline __forceinline
19
19
# define never_inline __declspec(noinline)
20
20
# define warn_unused_result
21
+ # define no_sanitize_undefined
21
22
22
23
# define likely (params ) (params)
23
24
# define unlikely (params ) (params)
46
47
# define warn_unused_result
47
48
# endif
48
49
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
+
49
61
# define likely (params ) __builtin_expect(!!(params), 1)
50
62
# define unlikely (params ) __builtin_expect(!!(params), 0)
51
63
#endif
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ static inline uint64_t count_ones(uint64_t bits) {
21
21
return (uint64_t )_mm_popcnt_u64 (bits );
22
22
}
23
23
24
+ no_sanitize_undefined
24
25
static inline uint64_t trailing_zeroes (uint64_t bits ) {
25
26
return (uint64_t )__builtin_ctzll (bits );
26
27
}
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ static inline uint64_t count_ones(uint64_t input_num) {
20
20
return (uint64_t )_mm_popcnt_u64 (input_num );
21
21
}
22
22
23
+ no_sanitize_undefined
23
24
static inline uint64_t trailing_zeroes (uint64_t input_num ) {
24
25
return (uint64_t )__builtin_ctzll (input_num );
25
26
}
You can’t perform that action at this time.
0 commit comments