Commit af078884 authored by Will Harris's avatar Will Harris Committed by Commit Bot

Fix an implicit 64-bit to 32-bit conversion in crashpad.

../../components/crash/content/app/minidump_with_crashpad_info.cc(142,45):  error: implicit conversion loses integer precision: 'int64_t' (aka 'long long') to 'crash_reporter::(anonymous namespace)::FilePosition' (aka 'unsigned int') [-Werror,-Wshorten-64-to-32]
  FilePosition next_available_byte = file_->Seek(base::File::FROM_END, 0);
               ~~~~~~~~~~~~~~~~~~~   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

BUG=588506

Change-Id: Ie5a6d95d459587e88e253ed3b3b35cdd714f2cdb
Reviewed-on: https://chromium-review.googlesource.com/1184339Reviewed-by: default avatarMark Mentovai <mark@chromium.org>
Commit-Queue: Will Harris <wfh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#585187}
parent 383a1a1f
......@@ -15,7 +15,6 @@ namespace crash_reporter {
namespace {
using FilePosition = uint32_t;
const FilePosition kInvalidFilePos = static_cast<FilePosition>(-1);
// This class is a helper to edit minidump files written by MiniDumpWriteDump.
// It assumes the minidump file it operates on has a directory entry pointing to
......@@ -139,9 +138,14 @@ bool MinidumpUpdater::AppendSimpleDictionary(
return false;
// Seek to the tail of the file, where we're going to extend it.
FilePosition next_available_byte = file_->Seek(base::File::FROM_END, 0);
if (next_available_byte == kInvalidFilePos)
int64_t seek_position = file_->Seek(base::File::FROM_END, 0);
if (seek_position == -1 ||
seek_position > std::numeric_limits<FilePosition>::max()) {
return false;
}
FilePosition next_available_byte = static_cast<FilePosition>(seek_position);
// Write the key/value pairs and collect their locations.
std::vector<crashpad::MinidumpSimpleStringDictionaryEntry> entries;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment