Skip to content

Commit 28e9a4f

Browse files
committed
Fix compile error in coreclr/vm/methodtable.cpp GetMethodDataHelper
$runtime/src/coreclr/vm/methodtable.cpp: In static member function 'static MethodTable::MethodData* MethodTable::GetMethodDataHelper(MethodTable*, MethodTable*, MethodDataComputeOptions)': $runtime/src/coreclr/vm/methodtable.cpp:7130:52: error: 'static void MethodTable::MethodDataInterface::operator delete(void*)' called on pointer returned from a mismatched allocation function [-Werror=mismatched-new-delete] 7130 | pData = new MethodDataInterface(pMTDecl); | ^ $runtime/src/coreclr/vm/methodtable.cpp:7130:52: note: returned from 'void* operator new(std::size_t)' 7130 | pData = new MethodDataInterface(pMTDecl); | ^
1 parent f2b0068 commit 28e9a4f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/coreclr/vm/methodtable.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3120,6 +3120,10 @@ public :
31203120
static void HolderRelease(MethodData *pEntry)
31213121
{ WRAPPER_NO_CONTRACT; if (pEntry != NULL) pEntry->Release(); }
31223122

3123+
static void* operator new(size_t size)
3124+
{
3125+
return ::operator new(size);
3126+
}
31233127
static void operator delete(void* ptr)
31243128
{
31253129
::operator delete(ptr);

0 commit comments

Comments
 (0)