mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-14 15:39:06 +00:00
Fix asan warning (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252617 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
76d9fb3a14
commit
69323c693c
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user