[llvm] r254471 - Define member operator delete
Xinliang David Li via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 1 15:05:27 PST 2015
Author: davidxl
Date: Tue Dec 1 17:05:27 2015
New Revision: 254471
URL: http://llvm.org/viewvc/llvm-project?rev=254471&view=rev
Log:
Define member operator delete
For the struct with trailing objects, define
a member operator delete. Without this, the program
will fail when -fsized-deallocation option is used
where the wrong size will be passed to the global
delete operator.
Modified:
llvm/trunk/include/llvm/ProfileData/InstrProfData.inc
Modified: llvm/trunk/include/llvm/ProfileData/InstrProfData.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ProfileData/InstrProfData.inc?rev=254471&r1=254470&r2=254471&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ProfileData/InstrProfData.inc (original)
+++ llvm/trunk/include/llvm/ProfileData/InstrProfData.inc Tue Dec 1 17:05:27 2015
@@ -291,6 +291,7 @@ typedef struct ValueProfData {
*/
void deserializeTo(InstrProfRecord &Record,
InstrProfRecord::ValueMapType *VMap);
+ void operator delete(void *ptr) { ::operator delete(ptr); }
#endif
} ValueProfData;
More information about the llvm-commits
mailing list