win: fix 64-bit build

The 64-bit win build broke in
https://chromium-review.googlesource.com/c/crashpad/crashpad/+/944192
but it was missed because we're missing 64-bit win buildbot coverage.

Change-Id: Ic3c40006c15bb85408bc869a0b595a652b9ac14e
Reviewed-on: https://chromium-review.googlesource.com/947716
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Joshua Peraza <jperaza@chromium.org>
This commit is contained in:
Joshua Peraza 2018-03-02 19:50:10 -08:00 committed by Commit Bot
parent 23b2156fb6
commit 4375233ad2

View File

@ -39,8 +39,8 @@
namespace crashpad {
int* g_extra_memory_pointer;
int* g_extra_memory_not_saved;
size_t* g_extra_memory_pointer;
size_t* g_extra_memory_not_saved;
namespace {
@ -142,29 +142,29 @@ void SomeCrashyFunction() {
void AllocateExtraMemoryToBeSaved(
crashpad::SimpleAddressRangeBag* extra_ranges) {
constexpr size_t kNumInts = 2000;
int* extra_memory = new int[kNumInts];
constexpr size_t kNumVals = 2000;
size_t* extra_memory = new size_t[kNumVals];
g_extra_memory_pointer = extra_memory;
for (size_t i = 0; i < kNumInts; ++i)
for (size_t i = 0; i < kNumVals; ++i)
extra_memory[i] = i * 13 + 2;
extra_ranges->Insert(extra_memory, sizeof(extra_memory[0]) * kNumInts);
extra_ranges->Insert(extra_memory, sizeof(extra_memory[0]) * kNumVals);
extra_ranges->Insert(&g_extra_memory_pointer, sizeof(g_extra_memory_pointer));
}
void AllocateExtraUnsavedMemory(crashpad::SimpleAddressRangeBag* extra_ranges) {
// Allocate some extra memory, and then Insert() but also Remove() it so we
// can confirm it doesn't get saved.
constexpr size_t kNumInts = 2000;
int* extra_memory = new int[kNumInts];
constexpr size_t kNumVals = 2000;
size_t* extra_memory = new size_t[kNumVals];
g_extra_memory_not_saved = extra_memory;
for (size_t i = 0; i < kNumInts; ++i)
for (size_t i = 0; i < kNumVals; ++i)
extra_memory[i] = i * 17 + 7;
extra_ranges->Insert(extra_memory, sizeof(extra_memory[0]) * kNumInts);
extra_ranges->Insert(extra_memory, sizeof(extra_memory[0]) * kNumVals);
extra_ranges->Insert(&g_extra_memory_not_saved,
sizeof(g_extra_memory_not_saved));
// We keep the pointer's memory, but remove the pointed-to memory.
extra_ranges->Remove(extra_memory, sizeof(extra_memory[0]) * kNumInts);
extra_ranges->Remove(extra_memory, sizeof(extra_memory[0]) * kNumVals);
}
int CrashyMain(int argc, wchar_t* argv[]) {