diff options
Diffstat (limited to 'compiler-rt/lib/asan/asan_globals.cc')
| -rw-r--r-- | compiler-rt/lib/asan/asan_globals.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/compiler-rt/lib/asan/asan_globals.cc b/compiler-rt/lib/asan/asan_globals.cc index 96972c19c20..713f6003e8e 100644 --- a/compiler-rt/lib/asan/asan_globals.cc +++ b/compiler-rt/lib/asan/asan_globals.cc @@ -36,10 +36,10 @@ static ListOfGlobals *list_of_globals; static LowLevelAllocator allocator_for_globals(LINKER_INITIALIZED); void PoisonRedZones(const Global &g) { - size_t shadow_rz_size = kGlobalAndStackRedzone >> SHADOW_SCALE; + uptr shadow_rz_size = kGlobalAndStackRedzone >> SHADOW_SCALE; CHECK(shadow_rz_size == 1 || shadow_rz_size == 2 || shadow_rz_size == 4); // full right redzone - size_t g_aligned_size = kGlobalAndStackRedzone * + uptr g_aligned_size = kGlobalAndStackRedzone * ((g.size + kGlobalAndStackRedzone - 1) / kGlobalAndStackRedzone); PoisonShadow(g.beg + g_aligned_size, kGlobalAndStackRedzone, kAsanGlobalRedzoneMagic); @@ -55,21 +55,21 @@ void PoisonRedZones(const Global &g) { } } -static size_t GetAlignedSize(size_t size) { +static uptr GetAlignedSize(uptr size) { return ((size + kGlobalAndStackRedzone - 1) / kGlobalAndStackRedzone) * kGlobalAndStackRedzone; } // Check if the global is a zero-terminated ASCII string. If so, print it. void PrintIfASCII(const Global &g) { - for (size_t p = g.beg; p < g.beg + g.size - 1; p++) { + for (uptr p = g.beg; p < g.beg + g.size - 1; p++) { if (!isascii(*(char*)p)) return; } if (*(char*)(g.beg + g.size - 1) != 0) return; Printf(" '%s' is ascii string '%s'\n", g.name, g.beg); } -bool DescribeAddrIfMyRedZone(const Global &g, uintptr_t addr) { +bool DescribeAddrIfMyRedZone(const Global &g, uptr addr) { if (addr < g.beg - kGlobalAndStackRedzone) return false; if (addr >= g.beg + g.size_with_redzone) return false; Printf("%p is located ", addr); @@ -87,7 +87,7 @@ bool DescribeAddrIfMyRedZone(const Global &g, uintptr_t addr) { } -bool DescribeAddrIfGlobal(uintptr_t addr) { +bool DescribeAddrIfGlobal(uptr addr) { if (!FLAG_report_globals) return false; ScopedLock lock(&mu_for_globals); bool res = false; |

