From a7c30f05016bcbc53ed30387ac1919bbff683859 Mon Sep 17 00:00:00 2001 From: Leonard Mosescu Date: Mon, 16 Apr 2018 10:23:21 -0700 Subject: [PATCH] Fix a few small issues found by GCC Building Crashpad with GCC flagged a few potential issues. The issues don't seem particularly severe, but they are easy enough to fix. Note that even with these changes, Crashpad will not cleanly build with GCC (additional patches would be needed to third_party/mini_chromium). Bug: crashpad: Change-Id: I9289d6c918da9a111aa3c2a078ad0dc1ba84749f Reviewed-on: https://chromium-review.googlesource.com/1014280 Reviewed-by: Joshua Peraza Commit-Queue: Leonard Mosescu --- handler/linux/exception_handler_server.cc | 1 + util/process/process_memory_test.cc | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/handler/linux/exception_handler_server.cc b/handler/linux/exception_handler_server.cc index 17fc18c8..447093dc 100644 --- a/handler/linux/exception_handler_server.cc +++ b/handler/linux/exception_handler_server.cc @@ -164,6 +164,7 @@ class PtraceStrategyDeciderImpl : public PtraceStrategyDecider { } DCHECK(false); + return Strategy::kError; } private: diff --git a/util/process/process_memory_test.cc b/util/process/process_memory_test.cc index 5827638f..741e58d6 100644 --- a/util/process/process_memory_test.cc +++ b/util/process/process_memory_test.cc @@ -350,7 +350,7 @@ void DoReadUnmappedChildMainSetup(ScopedMmap* pages, CRASHPAD_CHILD_TEST_MAIN(ReadUnmappedChildMain) { ScopedMmap pages; - VMAddress address; + VMAddress address = 0; size_t page_size, region_size; DoReadUnmappedChildMainSetup(&pages, &address, &page_size, ®ion_size); FileHandle out = StdioFileHandle(StdioStream::kStandardOutput); @@ -369,7 +369,7 @@ class ReadUnmappedTest : public MultiprocessExec { void RunAgainstSelf() { ScopedMmap pages; - VMAddress address; + VMAddress address = 0; size_t page_size, region_size; DoReadUnmappedChildMainSetup(&pages, &address, &page_size, ®ion_size); DoTest(GetSelfProcess(), address, page_size, region_size); @@ -379,7 +379,7 @@ class ReadUnmappedTest : public MultiprocessExec { private: void MultiprocessParent() override { - VMAddress address; + VMAddress address = 0; size_t page_size, region_size; ASSERT_TRUE(ReadFileExactly(ReadPipeHandle(), &address, sizeof(address))); ASSERT_TRUE(