diff options
Diffstat (limited to 'compiler-rt/lib/asan')
| -rw-r--r-- | compiler-rt/lib/asan/asan_fake_stack.cc | 2 | ||||
| -rw-r--r-- | compiler-rt/lib/asan/asan_fake_stack.h | 2 | ||||
| -rw-r--r-- | compiler-rt/lib/asan/asan_interceptors.cc | 2 | ||||
| -rw-r--r-- | compiler-rt/lib/asan/asan_poisoning.h | 2 | ||||
| -rw-r--r-- | compiler-rt/lib/asan/asan_report.cc | 16 |
5 files changed, 12 insertions, 12 deletions
diff --git a/compiler-rt/lib/asan/asan_fake_stack.cc b/compiler-rt/lib/asan/asan_fake_stack.cc index 23eebe64e61..2fe8ef4fe68 100644 --- a/compiler-rt/lib/asan/asan_fake_stack.cc +++ b/compiler-rt/lib/asan/asan_fake_stack.cc @@ -141,7 +141,7 @@ ALWAYS_INLINE uptr FakeStack::AllocateStack(uptr size, uptr real_stack) { ALWAYS_INLINE void FakeStack::DeallocateFrame(FakeFrame *fake_frame) { CHECK(alive_); - uptr size = fake_frame->size_minus_one + 1; + uptr size = static_cast<uptr>(fake_frame->size_minus_one + 1); uptr size_class = ComputeSizeClass(size); CHECK(allocated_size_classes_[size_class]); uptr ptr = (uptr)fake_frame; diff --git a/compiler-rt/lib/asan/asan_fake_stack.h b/compiler-rt/lib/asan/asan_fake_stack.h index 308b4c57183..a11a3dbe286 100644 --- a/compiler-rt/lib/asan/asan_fake_stack.h +++ b/compiler-rt/lib/asan/asan_fake_stack.h @@ -80,7 +80,7 @@ class FakeStack { static void OnFree(uptr ptr, uptr size, uptr real_stack); // Return the bottom of the maped region. uptr AddrIsInFakeStack(uptr addr); - bool StackSize() { return stack_size_; } + uptr StackSize() const { return stack_size_; } private: static const uptr kMinStackFrameSizeLog = 9; // Min frame is 512B. diff --git a/compiler-rt/lib/asan/asan_interceptors.cc b/compiler-rt/lib/asan/asan_interceptors.cc index d9dcb1c5240..3c85310814d 100644 --- a/compiler-rt/lib/asan/asan_interceptors.cc +++ b/compiler-rt/lib/asan/asan_interceptors.cc @@ -673,7 +673,7 @@ INTERCEPTOR_WINAPI(DWORD, CreateThread, u32 current_tid = GetCurrentTidOrInvalid(); AsanThread *t = AsanThread::Create(start_routine, arg); CreateThreadContextArgs args = { t, &stack }; - int detached = 0; // FIXME: how can we determine it on Windows? + bool detached = 0; // FIXME: how can we determine it on Windows? asanThreadRegistry().CreateThread(*(uptr*)t, detached, current_tid, &args); return REAL(CreateThread)(security, stack_size, asan_thread_start, t, flags, tid); diff --git a/compiler-rt/lib/asan/asan_poisoning.h b/compiler-rt/lib/asan/asan_poisoning.h index 86f81e5d0ae..91275465d70 100644 --- a/compiler-rt/lib/asan/asan_poisoning.h +++ b/compiler-rt/lib/asan/asan_poisoning.h @@ -50,7 +50,7 @@ ALWAYS_INLINE void FastPoisonShadowPartialRightRedzone( } else if (i >= size) { *shadow = (SHADOW_GRANULARITY == 128) ? 0xff : value; // unaddressable } else { - *shadow = size - i; // first size-i bytes are addressable + *shadow = static_cast<u8>(size - i); // first size-i bytes are addressable } } } diff --git a/compiler-rt/lib/asan/asan_report.cc b/compiler-rt/lib/asan/asan_report.cc index aeeebf452ca..f8cc906d3d1 100644 --- a/compiler-rt/lib/asan/asan_report.cc +++ b/compiler-rt/lib/asan/asan_report.cc @@ -125,7 +125,7 @@ static void PrintLegend() { "application bytes):\n", (int)SHADOW_GRANULARITY); PrintShadowByte(" Addressable: ", 0); Printf(" Partially addressable: "); - for (uptr i = 1; i < SHADOW_GRANULARITY; i++) + for (u8 i = 1; i < SHADOW_GRANULARITY; i++) PrintShadowByte("", i, " "); Printf("\n"); PrintShadowByte(" Heap left redzone: ", kAsanHeapLeftRedzoneMagic); @@ -267,7 +267,7 @@ const char *ThreadNameWithParenthesis(u32 tid, char buff[], bool DescribeAddressIfStack(uptr addr, uptr access_size) { AsanThread *t = FindThreadByStackAddress(addr); if (!t) return false; - const sptr kBufSize = 4095; + const s64 kBufSize = 4095; char buf[kBufSize]; uptr offset = 0; uptr frame_pc = 0; @@ -306,13 +306,13 @@ bool DescribeAddressIfStack(uptr addr, uptr access_size) { PrintStack(&alloca_stack); // Report the number of stack objects. char *p; - uptr n_objects = internal_simple_strtoll(frame_descr, &p, 10); + s64 n_objects = internal_simple_strtoll(frame_descr, &p, 10); CHECK_GT(n_objects, 0); Printf(" This frame has %zu object(s):\n", n_objects); // Report all objects in this frame. - for (uptr i = 0; i < n_objects; i++) { - uptr beg, size; - sptr len; + for (s64 i = 0; i < n_objects; i++) { + s64 beg, size; + s64 len; beg = internal_simple_strtoll(p, &p, 10); size = internal_simple_strtoll(p, &p, 10); len = internal_simple_strtoll(p, &p, 10); @@ -323,9 +323,9 @@ bool DescribeAddressIfStack(uptr addr, uptr access_size) { } p++; buf[0] = 0; - internal_strncat(buf, p, Min(kBufSize, len)); + internal_strncat(buf, p, static_cast<uptr>(Min(kBufSize, len))); p += len; - Printf(" [%zu, %zu) '%s'\n", beg, beg + size, buf); + Printf(" [%lld, %lld) '%s'\n", beg, beg + size, buf); } Printf("HINT: this may be a false positive if your program uses " "some custom stack unwind mechanism or swapcontext\n" |

