From 65bcfd03c73e0cc8fb6f661e7130712382533f1f Mon Sep 17 00:00:00 2001 From: Mike McLaughlin Date: Mon, 4 Jan 2021 19:09:49 -0800 Subject: [PATCH] Fix createdump fault in diagnostic tests (#46554) --- src/coreclr/debug/daccess/enummem.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/coreclr/debug/daccess/enummem.cpp b/src/coreclr/debug/daccess/enummem.cpp index d885ad3dd3bd7..5024153633409 100644 --- a/src/coreclr/debug/daccess/enummem.cpp +++ b/src/coreclr/debug/daccess/enummem.cpp @@ -542,9 +542,12 @@ HRESULT ClrDataAccess::DumpManagedExcepObject(CLRDataEnumMemoryFlags flags, OBJE PCODE addr = pMD->GetNativeCode(); if (addr != NULL) { - IJitManager::MethodRegionInfo methodRegionInfo = { NULL, 0, NULL, 0 }; EECodeInfo codeInfo(addr); - codeInfo.GetMethodRegionInfo(&methodRegionInfo); + if (codeInfo.IsValid()) + { + IJitManager::MethodRegionInfo methodRegionInfo = { NULL, 0, NULL, 0 }; + codeInfo.GetMethodRegionInfo(&methodRegionInfo); + } } }