Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 28f54a4

Browse files
author
Fadi Hanna
authored
Handle AV caused by invalid IBC data (#27029) (#27034)
Make FindOrCreateAssociatedMethodDesc throw a type load exception instead of an AV, which can't be handled by EX_TRY/EX_CATCH on Unix systems.
1 parent 5fcd92c commit 28f54a4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/vm/genmeth.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,11 @@ MethodDesc::FindOrCreateAssociatedMethodDesc(MethodDesc* pDefMD,
802802
// Some callers pass a pExactMT that is a subtype of a parent type of pDefMD.
803803
// Find the actual exact parent of pDefMD.
804804
pExactMT = pDefMD->GetExactDeclaringType(pExactMT);
805-
_ASSERTE(pExactMT != NULL);
805+
if (pExactMT == NULL)
806+
{
807+
_ASSERTE(false);
808+
COMPlusThrowHR(COR_E_TYPELOAD);
809+
}
806810

807811
if (pDefMD->HasClassOrMethodInstantiation() || !methodInst.IsEmpty())
808812
{

0 commit comments

Comments
 (0)