summaryrefslogtreecommitdiff
path: root/src/vm/codeman.cpp
diff options
context:
space:
mode:
authorAditya Mandaleeka <adityam@microsoft.com>2017-10-16 14:58:50 -0700
committerAditya Mandaleeka <adityam@microsoft.com>2017-10-16 15:30:23 -0700
commitbffa099cf4e279aaa0c34a2e7c9379f81cc51bb8 (patch)
tree97882278a3ad2b493a91e9624965b926b341804a /src/vm/codeman.cpp
parent65738239e7a50615d0fc50dcbe5b1b6086f96ef2 (diff)
downloadcoreclr-bffa099cf4e279aaa0c34a2e7c9379f81cc51bb8.tar.gz
coreclr-bffa099cf4e279aaa0c34a2e7c9379f81cc51bb8.tar.bz2
coreclr-bffa099cf4e279aaa0c34a2e7c9379f81cc51bb8.zip
Fix deadlock caused by R2R method info lookups during code heap
deletion.
Diffstat (limited to 'src/vm/codeman.cpp')
-rw-r--r--src/vm/codeman.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/vm/codeman.cpp b/src/vm/codeman.cpp
index 878119ca0d..a19ab8e0ae 100644
--- a/src/vm/codeman.cpp
+++ b/src/vm/codeman.cpp
@@ -6917,6 +6917,14 @@ BOOL ReadyToRunJitManager::JitCodeToMethodInfo(RangeSection * pRangeSection,
if (MethodIndex < 0)
return FALSE;
+ if (ppMethodDesc == NULL && pCodeInfo == NULL)
+ {
+ // Bail early if caller doesn't care about the MethodDesc or EECodeInfo.
+ // Avoiding the method desc lookups below also prevents deadlocks when this
+ // is called from IsManagedCode.
+ return TRUE;
+ }
+
#ifdef WIN64EXCEPTIONS
// Save the raw entry
PTR_RUNTIME_FUNCTION RawFunctionEntry = pRuntimeFunctions + MethodIndex;