OSDN Git Service
(root)
/
android-x86
/
external-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
76d9fb3
)
Fix asan warning (NFC)
author
Xinliang David Li
<davidxl@google.com>
Tue, 10 Nov 2015 17:11:33 +0000
(17:11 +0000)
committer
Xinliang David Li
<davidxl@google.com>
Tue, 10 Nov 2015 17:11:33 +0000
(17:11 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252617
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/ProfileData/InstrProf.cpp
patch
|
blob
|
history
diff --git
a/lib/ProfileData/InstrProf.cpp
b/lib/ProfileData/InstrProf.cpp
index
22c04fb
..
d74c51b
100644
(file)
--- a/
lib/ProfileData/InstrProf.cpp
+++ b/
lib/ProfileData/InstrProf.cpp
@@
-247,8
+247,9
@@
void ValueProfData::deserializeTo(InstrProfRecord &Record,
std::unique_ptr<ValueProfData>
ValueProfData::serializeFrom(const InstrProfRecord &Record) {
uint32_t TotalSize = getSize(Record);
- std::unique_ptr<ValueProfData> VPD(
- reinterpret_cast<ValueProfData *>(new char[TotalSize]));
+ void *RawMem = ::operator new(TotalSize);
+ ValueProfData *VPDMem = new (RawMem) ValueProfData();
+ std::unique_ptr<ValueProfData> VPD(VPDMem);
VPD->TotalSize = TotalSize;
VPD->NumValueKinds = Record.getNumValueKinds();