Skip to content

Commit c5598fa

Browse files
committed
rebase
1 parent bb7bd6e commit c5598fa

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

compiler-rt/lib/asan/asan_globals.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,9 @@ namespace __asan {
3333
typedef __asan_global Global;
3434

3535
struct GlobalListNode {
36-
const Global *g;
37-
GlobalListNode *next;
36+
const Global *g = nullptr;
37+
GlobalListNode *next = nullptr;
3838
};
39-
4039
typedef IntrusiveList<GlobalListNode> ListOfGlobals;
4140
typedef DenseMap<uptr, ListOfGlobals> MapOfGlobals;
4241

@@ -80,9 +79,7 @@ ALWAYS_INLINE void PoisonRedZones(const Global &g) {
8079
const uptr kMinimalDistanceFromAnotherGlobal = 64;
8180

8281
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});
8683
}
8784

8885
static bool IsAddressNearGlobal(uptr addr, const __asan_global &g) {
@@ -185,9 +182,10 @@ static void CheckODRViolationViaPoisoning(const Global *g) {
185182
for (const auto &l : list_of_all_globals) {
186183
if (g->beg == l.g->beg &&
187184
(flags()->detect_odr_violation >= 2 || g->size != l.g->size) &&
188-
!IsODRViolationSuppressed(g->name))
185+
!IsODRViolationSuppressed(g->name)) {
189186
ReportODRViolation(g, FindRegistrationSite(g), l.g,
190187
FindRegistrationSite(l.g));
188+
}
191189
}
192190
}
193191
}

0 commit comments

Comments
 (0)