diff options
author | Fadi Hanna <fadim@microsoft.com> | 2019-10-04 11:58:23 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-04 11:58:23 -0700 |
commit | 28f54a4013e85774e2a2793c5c7ca2b36948f996 (patch) | |
tree | 37766f681960b095d8a53ac47860066a21e001f0 /src/vm/genmeth.cpp | |
parent | 5fcd92cd8e44172b4bdd266fba9ce8938418540e (diff) | |
download | coreclr-28f54a4013e85774e2a2793c5c7ca2b36948f996.tar.gz coreclr-28f54a4013e85774e2a2793c5c7ca2b36948f996.tar.bz2 coreclr-28f54a4013e85774e2a2793c5c7ca2b36948f996.zip |
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.
Diffstat (limited to 'src/vm/genmeth.cpp')
-rw-r--r-- | src/vm/genmeth.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/vm/genmeth.cpp b/src/vm/genmeth.cpp index 5d09cdfbb4..d664fdc0fd 100644 --- a/src/vm/genmeth.cpp +++ b/src/vm/genmeth.cpp @@ -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()) { |