Skip to content

Commit a8bf8ce

Browse files
authored
Fix minidump generation - check if IsIL before calling methods related to it (#116391)
check if IsIL before calling methods related to it
1 parent 4cfcfa7 commit a8bf8ce

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

src/coreclr/vm/method.cpp

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3763,18 +3763,21 @@ MethodDesc::EnumMemoryRegions(CLRDataEnumMemoryFlags flags)
37633763

37643764
#ifdef FEATURE_CODE_VERSIONING
37653765
// Make sure the active IL and native code version are in triage dumps.
3766-
CodeVersionManager* pCodeVersionManager = GetCodeVersionManager();
3767-
ILCodeVersion ilVersion = pCodeVersionManager->GetActiveILCodeVersion(dac_cast<PTR_MethodDesc>(this));
3768-
if (!ilVersion.IsNull())
3769-
{
3770-
EX_TRY
3766+
if (IsIL())
3767+
{
3768+
CodeVersionManager* pCodeVersionManager = GetCodeVersionManager();
3769+
ILCodeVersion ilVersion = pCodeVersionManager->GetActiveILCodeVersion(dac_cast<PTR_MethodDesc>(this));
3770+
if (!ilVersion.IsNull())
37713771
{
3772-
ilVersion.GetActiveNativeCodeVersion(dac_cast<PTR_MethodDesc>(this));
3773-
ilVersion.GetVersionId();
3774-
ilVersion.GetRejitState();
3775-
ilVersion.GetIL();
3772+
EX_TRY
3773+
{
3774+
ilVersion.GetActiveNativeCodeVersion(dac_cast<PTR_MethodDesc>(this));
3775+
ilVersion.GetVersionId();
3776+
ilVersion.GetRejitState();
3777+
ilVersion.GetIL();
3778+
}
3779+
EX_CATCH_RETHROW_ONLY_COR_E_OPERATIONCANCELLED
37763780
}
3777-
EX_CATCH_RETHROW_ONLY_COR_E_OPERATIONCANCELLED
37783781
}
37793782
#endif
37803783

0 commit comments

Comments
 (0)