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

Unified Diff: minidump/minidump_rva_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_rva_list_writer.h ('k') | minidump/minidump_simple_string_dictionary_writer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: minidump/minidump_rva_list_writer.cc
diff --git a/minidump/minidump_rva_list_writer.cc b/minidump/minidump_rva_list_writer.cc
index 70ffe4f017acd650659ff96b28dcfdebe3529241..74508305083cc6f40c09f2f0e14963c73bcf938b 100644
--- a/minidump/minidump_rva_list_writer.cc
+++ b/minidump/minidump_rva_list_writer.cc
@@ -23,7 +23,7 @@ namespace internal {
MinidumpRVAListWriter::MinidumpRVAListWriter()
: MinidumpWritable(),
- rva_list_base_(),
+ rva_list_base_(new MinidumpRVAList()),
children_(),
child_rvas_() {
}
@@ -46,7 +46,7 @@ bool MinidumpRVAListWriter::Freeze() {
}
size_t child_count = children_.size();
- if (!AssignIfInRange(&rva_list_base_.count, child_count)) {
+ if (!AssignIfInRange(&rva_list_base_->count, child_count)) {
LOG(ERROR) << "child_count " << child_count << " out of range";
return false;
}
@@ -62,7 +62,7 @@ bool MinidumpRVAListWriter::Freeze() {
size_t MinidumpRVAListWriter::SizeOfObject() {
DCHECK_GE(state(), kStateFrozen);
- return sizeof(rva_list_base_) + children_.size() * sizeof(RVA);
+ return sizeof(*rva_list_base_) + children_.size() * sizeof(RVA);
}
std::vector<MinidumpWritable*> MinidumpRVAListWriter::Children() {
@@ -81,8 +81,8 @@ bool MinidumpRVAListWriter::WriteObject(FileWriterInterface* file_writer) {
DCHECK_EQ(children_.size(), child_rvas_.size());
WritableIoVec iov;
- iov.iov_base = &rva_list_base_;
- iov.iov_len = sizeof(rva_list_base_);
+ iov.iov_base = rva_list_base_.get();
+ iov.iov_len = sizeof(*rva_list_base_);
std::vector<WritableIoVec> iovecs(1, iov);
if (!child_rvas_.empty()) {
« no previous file with comments | « minidump/minidump_rva_list_writer.h ('k') | minidump/minidump_simple_string_dictionary_writer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698