Skip to content

Commit df150ad

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 df150ad

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/coreclr/vm/methodtable.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7127,7 +7127,7 @@ MethodTable::MethodData *MethodTable::GetMethodDataHelper(MethodTable *pMTDecl,
71277127
// If we get here, there are no entries in the cache.
71287128
if (pMTDecl == pMTImpl) {
71297129
if (pMTDecl->IsInterface()) {
7130-
pData = new MethodDataInterface(pMTDecl);
7130+
pData = new (pMTDecl) MethodDataInterface(pMTDecl);
71317131
}
71327132
else {
71337133
MethodDataHolder h(FindParentMethodDataHelper(pMTDecl));

0 commit comments

Comments
 (0)