[llvm] r255680 - Initialize all bytes in vp data (msan error)
Xinliang David Li via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 15 13:57:08 PST 2015
Author: davidxl
Date: Tue Dec 15 15:57:08 2015
New Revision: 255680
URL: http://llvm.org/viewvc/llvm-project?rev=255680&view=rev
Log:
Initialize all bytes in vp data (msan error)
Modified:
llvm/trunk/lib/ProfileData/InstrProf.cpp
Modified: llvm/trunk/lib/ProfileData/InstrProf.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ProfileData/InstrProf.cpp?rev=255680&r1=255679&r2=255680&view=diff
==============================================================================
--- llvm/trunk/lib/ProfileData/InstrProf.cpp (original)
+++ llvm/trunk/lib/ProfileData/InstrProf.cpp Tue Dec 15 15:57:08 2015
@@ -211,8 +211,10 @@ uint64_t stringToHash(uint32_t ValueKind
}
ValueProfData *allocValueProfDataInstrProf(size_t TotalSizeInBytes) {
- return (ValueProfData *)(new (::operator new(TotalSizeInBytes))
- ValueProfData());
+ ValueProfData *VD =
+ (ValueProfData *)(new (::operator new(TotalSizeInBytes)) ValueProfData());
+ memset(VD, 0, TotalSizeInBytes);
+ return VD;
}
static ValueProfRecordClosure InstrProfRecordClosure = {
@@ -223,8 +225,7 @@ static ValueProfRecordClosure InstrProfR
getNumValueDataForSiteInstrProf,
stringToHash,
getValueForSiteInstrProf,
- allocValueProfDataInstrProf
-};
+ allocValueProfDataInstrProf};
// Wrapper implementation using the closure mechanism.
uint32_t ValueProfData::getSize(const InstrProfRecord &Record) {
More information about the llvm-commits
mailing list