From 4375233ad2dad48f2332ecc20221df10f98b668a Mon Sep 17 00:00:00 2001 From: Joshua Peraza Date: Fri, 2 Mar 2018 19:50:10 -0800 Subject: [PATCH] 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 Commit-Queue: Joshua Peraza --- handler/win/crashy_test_program.cc | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/handler/win/crashy_test_program.cc b/handler/win/crashy_test_program.cc index 5555cac3..bed19b3c 100644 --- a/handler/win/crashy_test_program.cc +++ b/handler/win/crashy_test_program.cc @@ -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[]) {