@@ -33,10 +33,9 @@ namespace __asan {
33
33
typedef __asan_global Global;
34
34
35
35
struct GlobalListNode {
36
- const Global *g;
37
- GlobalListNode *next;
36
+ const Global *g = nullptr ;
37
+ GlobalListNode *next = nullptr ;
38
38
};
39
-
40
39
typedef IntrusiveList<GlobalListNode> ListOfGlobals;
41
40
typedef DenseMap<uptr, ListOfGlobals> MapOfGlobals;
42
41
@@ -80,9 +79,7 @@ ALWAYS_INLINE void PoisonRedZones(const Global &g) {
80
79
const uptr kMinimalDistanceFromAnotherGlobal = 64 ;
81
80
82
81
static void AddGlobalToList (ListOfGlobals &list, const Global *g) {
83
- GlobalListNode *l = new (GetGlobalLowLevelAllocator ()) GlobalListNode;
84
- l->g = g;
85
- list.push_front (l);
82
+ list.push_front (new (GetGlobalLowLevelAllocator ()) GlobalListNode{g});
86
83
}
87
84
88
85
static bool IsAddressNearGlobal (uptr addr, const __asan_global &g) {
@@ -185,9 +182,10 @@ static void CheckODRViolationViaPoisoning(const Global *g) {
185
182
for (const auto &l : list_of_all_globals) {
186
183
if (g->beg == l.g ->beg &&
187
184
(flags ()->detect_odr_violation >= 2 || g->size != l.g ->size ) &&
188
- !IsODRViolationSuppressed (g->name ))
185
+ !IsODRViolationSuppressed (g->name )) {
189
186
ReportODRViolation (g, FindRegistrationSite (g), l.g ,
190
187
FindRegistrationSite (l.g ));
188
+ }
191
189
}
192
190
}
193
191
}
0 commit comments