summaryrefslogtreecommitdiff
path: root/src/zap/zapinfo.cpp
diff options
context:
space:
mode:
authorPat Gavlin <pagavlin@microsoft.com>2016-04-29 13:23:52 -0700
committerPat Gavlin <pagavlin@microsoft.com>2016-04-29 13:23:52 -0700
commitf3a2277c8c37a29417562cfa478935ddbb801fe7 (patch)
treeb58c58a12bb30f832222426ae487992f21dd103b /src/zap/zapinfo.cpp
parent23d0b7a74a67094c070af3477d06677bf19173d0 (diff)
downloadcoreclr-f3a2277c8c37a29417562cfa478935ddbb801fe7.tar.gz
coreclr-f3a2277c8c37a29417562cfa478935ddbb801fe7.tar.bz2
coreclr-f3a2277c8c37a29417562cfa478935ddbb801fe7.zip
Eliminate SEH interactions between the JIT and the EE during verification.
For compatibility reasons, `BadImageFormatException`s that are thrown when resolving tokens during verification are transformed instead into verification exceptions. This transformation currently takes place in the JIT: the JIT wraps relevant calls to `ICorJitInfo::resolveToken` with a `__try`/`__except` that handles any exceptions that arise due to invalid metadata. This method cannot be relied on when consuming the JIT as a dynamic library on non-Windows platforms due to type identity problems in the runtime's SEH emulation. Furthermore, these filters cannot use the proposed solution to the JIT's other uses of SEH across the JIT/EE interface, since they are more complex than a call to `ICorJitInfo::FilterException`. Instead, this change introduces a new method, `ICorJitInfo::tryResolveToken`, which is only used during verification. This method implements filtering that is equivalent to the current implementation, but does so in the EE rather than in the JIT. This is part of GitHub bugs #3058 and #4130. [tfs-changeset: 1600443]
Diffstat (limited to 'src/zap/zapinfo.cpp')
-rw-r--r--src/zap/zapinfo.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/zap/zapinfo.cpp b/src/zap/zapinfo.cpp
index 345a920902..4d2d7f8636 100644
--- a/src/zap/zapinfo.cpp
+++ b/src/zap/zapinfo.cpp
@@ -3455,6 +3455,12 @@ void ZapInfo::resolveToken(CORINFO_RESOLVED_TOKEN * pResolvedToken)
}
//-----------------------------------------------------------------------------
+bool ZapInfo::tryResolveToken(CORINFO_RESOLVED_TOKEN * pResolvedToken)
+{
+ return m_pEEJitInfo->tryResolveToken(pResolvedToken);
+}
+
+//-----------------------------------------------------------------------------
void ZapInfo::findSig(CORINFO_MODULE_HANDLE tokenScope,
unsigned sigTOK,
CORINFO_CONTEXT_HANDLE tokenContext,