Fixup files added in r362636 to build with gcc 5.4. NFCI
am: ec0922ee67
Change-Id: I246cc96f1a146612267e49246cdad3840ca7fbb5
diff --git a/gwp_asan/guarded_pool_allocator.cpp b/gwp_asan/guarded_pool_allocator.cpp
index cd24a9f..93743cd 100644
--- a/gwp_asan/guarded_pool_allocator.cpp
+++ b/gwp_asan/guarded_pool_allocator.cpp
@@ -260,9 +260,9 @@
return Offset;
}
-void GuardedPoolAllocator::reportError(uintptr_t AccessPtr, Error Error) {
+void GuardedPoolAllocator::reportError(uintptr_t AccessPtr, Error E) {
if (SingletonPtr)
- SingletonPtr->reportErrorInternal(AccessPtr, Error);
+ SingletonPtr->reportErrorInternal(AccessPtr, E);
}
size_t GuardedPoolAllocator::getNearestSlot(uintptr_t Ptr) const {
@@ -311,9 +311,9 @@
// Prints the provided error and metadata information. Returns true if there is
// additional context that can be provided, false otherwise (i.e. returns false
// if Error == {UNKNOWN, INVALID_FREE without metadata}).
-bool printErrorType(Error Error, uintptr_t AccessPtr, AllocationMetadata *Meta,
+bool printErrorType(Error E, uintptr_t AccessPtr, AllocationMetadata *Meta,
options::Printf_t Printf) {
- switch (Error) {
+ switch (E) {
case Error::UNKNOWN:
Printf("GWP-ASan couldn't automatically determine the source of the "
"memory error when accessing 0x%zx. It was likely caused by a wild "
@@ -361,7 +361,7 @@
return true;
}
-void printThreadInformation(Error Error, uintptr_t AccessPtr,
+void printThreadInformation(Error E, uintptr_t AccessPtr,
AllocationMetadata *Meta,
options::Printf_t Printf) {
Printf("0x%zx was allocated by thread ", AccessPtr);
@@ -370,7 +370,7 @@
else
Printf("%zu.\n", Meta->AllocationTrace.ThreadID);
- if (Error == Error::USE_AFTER_FREE || Error == Error::DOUBLE_FREE) {
+ if (E == Error::USE_AFTER_FREE || E == Error::DOUBLE_FREE) {
Printf("0x%zx was freed by thread ", AccessPtr);
if (Meta->AllocationTrace.ThreadID == UINT64_MAX)
Printf("UNKNOWN.\n");
@@ -386,7 +386,7 @@
};
void GuardedPoolAllocator::reportErrorInternal(uintptr_t AccessPtr,
- Error Error) {
+ Error E) {
if (!pointerIsMine(reinterpret_cast<void *>(AccessPtr))) {
return;
}
@@ -401,8 +401,8 @@
AllocationMetadata *Meta = nullptr;
- if (Error == Error::UNKNOWN) {
- Error = diagnoseUnknownError(AccessPtr, &Meta);
+ if (E == Error::UNKNOWN) {
+ E = diagnoseUnknownError(AccessPtr, &Meta);
} else {
size_t Slot = getNearestSlot(AccessPtr);
Meta = addrToMetadata(slotToAddr(Slot));
@@ -412,7 +412,7 @@
}
// Print the error information, and if there is no valid metadata, stop here.
- if (!printErrorType(Error, AccessPtr, Meta, Printf)) {
+ if (!printErrorType(E, AccessPtr, Meta, Printf)) {
return;
}
@@ -422,7 +422,7 @@
return;
}
- printThreadInformation(Error, AccessPtr, Meta, Printf);
+ printThreadInformation(E, AccessPtr, Meta, Printf);
// TODO(hctim): Implement stack unwinding here. Ask the caller to provide us
// with the base pointer, and we unwind the stack to give a stack trace for
// the access.
diff --git a/gwp_asan/guarded_pool_allocator.h b/gwp_asan/guarded_pool_allocator.h
index af2a504..50d9baf 100644
--- a/gwp_asan/guarded_pool_allocator.h
+++ b/gwp_asan/guarded_pool_allocator.h
@@ -135,7 +135,7 @@
// singleton pointer and call the internal version of this function. This
// method is never thread safe, and should only be called when fatal errors
// occur.
- static void reportError(uintptr_t AccessPtr, Error Error = Error::UNKNOWN);
+ static void reportError(uintptr_t AccessPtr, Error E = Error::UNKNOWN);
private:
static constexpr size_t kInvalidSlotID = SIZE_MAX;
@@ -204,7 +204,7 @@
// responsible for the error is placed in *Meta.
Error diagnoseUnknownError(uintptr_t AccessPtr, AllocationMetadata **Meta);
- void reportErrorInternal(uintptr_t AccessPtr, Error Error);
+ void reportErrorInternal(uintptr_t AccessPtr, Error E);
// Cached page size for this system in bytes.
size_t PageSize = 0;