diff options
author | Douglas Yung <douglas.yung@sony.com> | 2019-06-06 08:04:33 +0000 |
---|---|---|
committer | Douglas Yung <douglas.yung@sony.com> | 2019-06-06 08:04:33 +0000 |
commit | dbceb9b2203b58f829e911c8d1610b95d9abf192 (patch) | |
tree | e6816e5676775119e7b4db4b16a8d388a34d6e25 | |
parent | d3144a4abc8be435ab2adbe6dd224bcdd44c497e (diff) | |
download | bcm5719-llvm-dbceb9b2203b58f829e911c8d1610b95d9abf192.tar.gz bcm5719-llvm-dbceb9b2203b58f829e911c8d1610b95d9abf192.zip |
Fixup files added in r362636 to build with gcc 5.4. NFCI
llvm-svn: 362682
-rw-r--r-- | compiler-rt/lib/gwp_asan/guarded_pool_allocator.cpp | 22 | ||||
-rw-r--r-- | compiler-rt/lib/gwp_asan/guarded_pool_allocator.h | 4 |
2 files changed, 13 insertions, 13 deletions
diff --git a/compiler-rt/lib/gwp_asan/guarded_pool_allocator.cpp b/compiler-rt/lib/gwp_asan/guarded_pool_allocator.cpp index cd24a9fe79b..93743cd5132 100644 --- a/compiler-rt/lib/gwp_asan/guarded_pool_allocator.cpp +++ b/compiler-rt/lib/gwp_asan/guarded_pool_allocator.cpp @@ -260,9 +260,9 @@ uintptr_t GuardedPoolAllocator::allocationSlotOffset(size_t Size) const { 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 @@ Error GuardedPoolAllocator::diagnoseUnknownError(uintptr_t AccessPtr, // 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 @@ bool printErrorType(Error Error, uintptr_t AccessPtr, AllocationMetadata *Meta, 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 @@ void printThreadInformation(Error Error, uintptr_t AccessPtr, 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 @@ struct ScopedEndOfReportDecorator { }; void GuardedPoolAllocator::reportErrorInternal(uintptr_t AccessPtr, - Error Error) { + Error E) { if (!pointerIsMine(reinterpret_cast<void *>(AccessPtr))) { return; } @@ -401,8 +401,8 @@ void GuardedPoolAllocator::reportErrorInternal(uintptr_t AccessPtr, 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 @@ void GuardedPoolAllocator::reportErrorInternal(uintptr_t AccessPtr, } // 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 @@ void GuardedPoolAllocator::reportErrorInternal(uintptr_t AccessPtr, 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/compiler-rt/lib/gwp_asan/guarded_pool_allocator.h b/compiler-rt/lib/gwp_asan/guarded_pool_allocator.h index af2a5044a14..50d9baf4ffc 100644 --- a/compiler-rt/lib/gwp_asan/guarded_pool_allocator.h +++ b/compiler-rt/lib/gwp_asan/guarded_pool_allocator.h @@ -135,7 +135,7 @@ public: // 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 @@ private: // 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; |