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

Commit

Permalink
Handle AV caused by invalid IBC data (#27029) (#27034)
Browse files Browse the repository at this point in the history
Make FindOrCreateAssociatedMethodDesc throw a type load exception instead of an AV, which can't be handled by EX_TRY/EX_CATCH on Unix systems.
  • Loading branch information
Fadi Hanna authored Oct 4, 2019
1 parent 5fcd92c commit 28f54a4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/vm/genmeth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,11 @@ MethodDesc::FindOrCreateAssociatedMethodDesc(MethodDesc* pDefMD,
// Some callers pass a pExactMT that is a subtype of a parent type of pDefMD.
// Find the actual exact parent of pDefMD.
pExactMT = pDefMD->GetExactDeclaringType(pExactMT);
_ASSERTE(pExactMT != NULL);
if (pExactMT == NULL)
{
_ASSERTE(false);
COMPlusThrowHR(COR_E_TYPELOAD);
}

if (pDefMD->HasClassOrMethodInstantiation() || !methodInst.IsEmpty())
{
Expand Down

0 comments on commit 28f54a4

Please sign in to comment.