summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXinliang David Li <davidxl@google.com>2015-12-15 21:57:08 +0000
committerXinliang David Li <davidxl@google.com>2015-12-15 21:57:08 +0000
commit38b9a32fcd2c90005f82934da8169bbc7f37db0e (patch)
tree8ce8eac98259e103ef24d80e740f8157cdd3230d
parent5f97bbaa9c5b84073c96acfaee392e82b9ed38d2 (diff)
downloadbcm5719-llvm-38b9a32fcd2c90005f82934da8169bbc7f37db0e.tar.gz
bcm5719-llvm-38b9a32fcd2c90005f82934da8169bbc7f37db0e.zip
Initialize all bytes in vp data (msan error)
llvm-svn: 255680
-rw-r--r--llvm/lib/ProfileData/InstrProf.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/ProfileData/InstrProf.cpp b/llvm/lib/ProfileData/InstrProf.cpp
index 723408b1c2a..00c9057c8b4 100644
--- a/llvm/lib/ProfileData/InstrProf.cpp
+++ b/llvm/lib/ProfileData/InstrProf.cpp
@@ -211,8 +211,10 @@ uint64_t stringToHash(uint32_t ValueKind, uint64_t Value) {
}
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 InstrProfRecordClosure = {
getNumValueDataForSiteInstrProf,
stringToHash,
getValueForSiteInstrProf,
- allocValueProfDataInstrProf
-};
+ allocValueProfDataInstrProf};
// Wrapper implementation using the closure mechanism.
uint32_t ValueProfData::getSize(const InstrProfRecord &Record) {
OpenPOWER on IntegriCloud