[memprof] Fix rawprofile test on 32-bit architectures
authorMarco Elver <elver@google.com>
Wed, 7 Jun 2023 14:17:08 +0000 (16:17 +0200)
committerMarco Elver <elver@google.com>
Thu, 8 Jun 2023 11:03:08 +0000 (13:03 +0200)
The first argument of StackTrace constructor is a pointer to uptr. Match
the type accordingly.

This fixes builds on 32-bit architectures.

compiler-rt/lib/memprof/tests/rawprofile.cpp

index 3c7372a..0637ed9 100644 (file)
@@ -19,10 +19,10 @@ using ::__sanitizer::StackDepotPut;
 using ::__sanitizer::StackTrace;
 using ::llvm::memprof::MemInfoBlock;
 
-uint64_t PopulateFakeMap(const MemInfoBlock &FakeMIB, uint64_t StackPCBegin,
+uint64_t PopulateFakeMap(const MemInfoBlock &FakeMIB, uintptr_t StackPCBegin,
                          MIBMapTy &FakeMap) {
   constexpr int kSize = 5;
-  uint64_t array[kSize];
+  uintptr_t array[kSize];
   for (int i = 0; i < kSize; i++) {
     array[i] = StackPCBegin + i;
   }