Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Unified Diff: minidump/minidump_location_descriptor_list_writer.cc

Issue 896663006: win: Resolve zero-length array errors on MSVC (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@minidump-comp
Patch Set: fixes Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « minidump/minidump_location_descriptor_list_writer.h ('k') | minidump/minidump_memory_writer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: minidump/minidump_location_descriptor_list_writer.cc
diff --git a/minidump/minidump_location_descriptor_list_writer.cc b/minidump/minidump_location_descriptor_list_writer.cc
index f4f23a941b99be1a39e082970f5592c9a3ea9541..24bcbf530450011f970302493facad621700f76b 100644
--- a/minidump/minidump_location_descriptor_list_writer.cc
+++ b/minidump/minidump_location_descriptor_list_writer.cc
@@ -23,7 +23,7 @@ namespace internal {
MinidumpLocationDescriptorListWriter::MinidumpLocationDescriptorListWriter()
: MinidumpWritable(),
- location_descriptor_list_base_(),
+ location_descriptor_list_base_(new MinidumpLocationDescriptorList()),
children_(),
child_location_descriptors_() {
}
@@ -47,7 +47,8 @@ bool MinidumpLocationDescriptorListWriter::Freeze() {
}
size_t child_count = children_.size();
- if (!AssignIfInRange(&location_descriptor_list_base_.count, child_count)) {
+ if (!AssignIfInRange(&location_descriptor_list_base_->count,
+ child_count)) {
LOG(ERROR) << "child_count " << child_count << " out of range";
return false;
}
@@ -64,7 +65,7 @@ bool MinidumpLocationDescriptorListWriter::Freeze() {
size_t MinidumpLocationDescriptorListWriter::SizeOfObject() {
DCHECK_GE(state(), kStateFrozen);
- return sizeof(location_descriptor_list_base_) +
+ return sizeof(*location_descriptor_list_base_) +
children_.size() * sizeof(MINIDUMP_LOCATION_DESCRIPTOR);
}
@@ -86,8 +87,8 @@ bool MinidumpLocationDescriptorListWriter::WriteObject(
DCHECK_EQ(children_.size(), child_location_descriptors_.size());
WritableIoVec iov;
- iov.iov_base = &location_descriptor_list_base_;
- iov.iov_len = sizeof(location_descriptor_list_base_);
+ iov.iov_base = location_descriptor_list_base_.get();
+ iov.iov_len = sizeof(*location_descriptor_list_base_);
std::vector<WritableIoVec> iovecs(1, iov);
if (!child_location_descriptors_.empty()) {
« no previous file with comments | « minidump/minidump_location_descriptor_list_writer.h ('k') | minidump/minidump_memory_writer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698