MinidumpCrashpadInfo: the default constructor should zero-initialize.

This regressed in 359bdd86225c when a non-POD UUID data member was added
to MinidumpCrashpadInfo, which made MinidumpCrashpadInfo non-POD. This
problem seems to have affected MinidumpModuleCodeViewRecordPDB70 since
it was added, but it is not likely to have caused any problems there
because that structure never appears without having all of its members
populated. By comparison, MinidumpCrashpadInfo may be sparsely
populated.

This caused 4 of the 5 MinidumpCrashpadInfoWriter tests to fail on
Windows.

TEST=crashpad_minidump_test MinidumpCrashpadInfoWriter.*
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/1001683002
This commit is contained in:
Mark Mentovai 2015-03-11 17:43:46 -04:00
parent 359bdd8622
commit 94f7f9eeb2

View File

@ -283,6 +283,16 @@ struct MinidumpModuleCodeViewRecordPDB20 {
//! \sa MinidumpModuleCodeViewRecordPDB20
//! \sa IMAGE_DEBUG_MISC
struct MinidumpModuleCodeViewRecordPDB70 {
// UUID has a constructor, which makes it non-POD, which makes this structure
// non-POD. In order for the default constructor to zero-initialize other
// members, an explicit constructor must be provided.
MinidumpModuleCodeViewRecordPDB70()
: signature(),
uuid(),
age(),
pdb_name() {
}
//! \brief The magic number identifying this structure version, stored in
//! #signature.
//!
@ -444,6 +454,16 @@ struct ALIGNAS(4) PACKED MinidumpModuleCrashpadInfoList {
//! #version, so that newer parsers will be able to determine whether the added
//! fields are valid or not.
struct ALIGNAS(4) PACKED MinidumpCrashpadInfo {
// UUID has a constructor, which makes it non-POD, which makes this structure
// non-POD. In order for the default constructor to zero-initialize other
// members, an explicit constructor must be provided.
MinidumpCrashpadInfo()
: version(),
client_id(),
simple_annotations(),
module_list() {
}
//! \brief The structures currently-defined version number.
//!
//! \sa version