aboutsummaryrefslogtreecommitdiff
path: root/src/processor/minidump.cc
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e>2013-12-17 22:21:40 +0000
committerthestig@chromium.org <thestig@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e>2013-12-17 22:21:40 +0000
commit6199766d99ec34485f5c62299939f3586d279143 (patch)
treed9e2e4165af29814889cc89c4694989178c27bc0 /src/processor/minidump.cc
parentRun svn propdel svn:executable on source code files. (diff)
downloadbreakpad-6199766d99ec34485f5c62299939f3586d279143.tar.xz
Fix warnings from the Windows build.
These warnings are fatal in my GYP-generated debug build. The warnings can be seen on Linux/Mac with -Wshorten-64-to-32. R=mark@chromium.org Review URL: https://breakpad.appspot.com/944002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1264 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/processor/minidump.cc')
-rw-r--r--src/processor/minidump.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/processor/minidump.cc b/src/processor/minidump.cc
index ab3aba10..5e81e67e 100644
--- a/src/processor/minidump.cc
+++ b/src/processor/minidump.cc
@@ -603,7 +603,6 @@ bool MinidumpContext::Read(uint32_t expected_size) {
}
context_.ppc64 = context_ppc64.release();
- context_flags_ = context_flags;
} else if (expected_size == sizeof(MDRawContextARM64)) {
// |context_flags| of MDRawContextARM64 is 64 bits, but other MDRawContext
// in the else case have 32 bits |context_flags|, so special case it here.
@@ -678,8 +677,17 @@ bool MinidumpContext::Read(uint32_t expected_size) {
Swap(&context_arm64->float_save.regs[fpr_index]);
}
}
+ context_flags_ = static_cast<uint32_t>(context_arm64->context_flags);
+
+ // Check for data loss when converting context flags from uint64_t into
+ // uint32_t
+ if (static_cast<uint64_t>(context_flags_) !=
+ context_arm64->context_flags) {
+ BPLOG(ERROR) << "Data loss detected when converting ARM64 context_flags";
+ return false;
+ }
+
context_.arm64 = context_arm64.release();
- context_flags_ = context_flags;
} else {
uint32_t context_flags;
if (!minidump_->ReadBytes(&context_flags, sizeof(context_flags))) {