Skip to content

Commit c578508

Browse files
committed
Revert "[compiler-rt][asan] Make wild-pointer crash error more useful"
This reverts commit f65e1ae.
1 parent 5908c7c commit c578508

File tree

3 files changed

+5
-39
lines changed

3 files changed

+5
-39
lines changed

compiler-rt/lib/asan/asan_descriptions.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ static bool GetShadowKind(uptr addr, ShadowKind *shadow_kind) {
7777
} else if (AddrIsInLowShadow(addr)) {
7878
*shadow_kind = kShadowKindLow;
7979
} else {
80+
CHECK(0 && "Address is not in memory and not in shadow?");
8081
return false;
8182
}
8283
return true;
@@ -463,13 +464,7 @@ AddressDescription::AddressDescription(uptr addr, uptr access_size,
463464
return;
464465
}
465466
data.kind = kAddressKindWild;
466-
data.wild.addr = addr;
467-
data.wild.access_size = access_size;
468-
}
469-
470-
void WildAddressDescription::Print() const {
471-
Printf("Address %p is a wild pointer inside of access range of size %p.\n",
472-
addr, access_size);
467+
addr = 0;
473468
}
474469

475470
void PrintAddressDescription(uptr addr, uptr access_size,

compiler-rt/lib/asan/asan_descriptions.h

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -146,13 +146,6 @@ struct StackAddressDescription {
146146
bool GetStackAddressInformation(uptr addr, uptr access_size,
147147
StackAddressDescription *descr);
148148

149-
struct WildAddressDescription {
150-
uptr addr;
151-
uptr access_size;
152-
153-
void Print() const;
154-
};
155-
156149
struct GlobalAddressDescription {
157150
uptr addr;
158151
// Assume address is close to at most four globals.
@@ -200,7 +193,7 @@ class AddressDescription {
200193
HeapAddressDescription heap;
201194
StackAddressDescription stack;
202195
GlobalAddressDescription global;
203-
WildAddressDescription wild;
196+
uptr addr;
204197
};
205198
};
206199

@@ -218,7 +211,7 @@ class AddressDescription {
218211
uptr Address() const {
219212
switch (data.kind) {
220213
case kAddressKindWild:
221-
return data.wild.addr;
214+
return data.addr;
222215
case kAddressKindShadow:
223216
return data.shadow.addr;
224217
case kAddressKindHeap:
@@ -233,7 +226,7 @@ class AddressDescription {
233226
void Print(const char *bug_descr = nullptr) const {
234227
switch (data.kind) {
235228
case kAddressKindWild:
236-
data.wild.Print();
229+
Printf("Address %p is a wild pointer.\n", data.addr);
237230
return;
238231
case kAddressKindShadow:
239232
return data.shadow.Print();

compiler-rt/test/asan/TestCases/wild_pointer.cpp

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)