From f8523215d17e4ace44efbc6b398bac10e080ffa8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 12 Mar 2026 16:31:02 +0000 Subject: [PATCH 1/2] Initial plan From 3b7805532561716953dd70b79dfbcb4b80c48ea2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 12 Mar 2026 16:42:42 +0000 Subject: [PATCH 2/2] Remove redundant NULL check for pDir in GetMetaDataFileInfoFromPEFile Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com> --- src/coreclr/debug/daccess/daccess.cpp | 29 +++++++++++---------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/src/coreclr/debug/daccess/daccess.cpp b/src/coreclr/debug/daccess/daccess.cpp index 0871ad697e8d0d..2f9e7abc2bfdeb 100644 --- a/src/coreclr/debug/daccess/daccess.cpp +++ b/src/coreclr/debug/daccess/daccess.cpp @@ -6378,27 +6378,22 @@ ClrDataAccess::GetMetaDataFileInfoFromPEFile(PEAssembly *pPEAssembly, SUPPORTS_DAC_HOST_ONLY; PEImage *mdImage = NULL; PEImageLayout *layout = NULL; - IMAGE_DATA_DIRECTORY *pDir = NULL; COUNT_T uniPathChars = 0; - if (pDir == NULL || pDir->Size == 0) + mdImage = pPEAssembly->GetPEImage(); + if (mdImage != NULL) { - mdImage = pPEAssembly->GetPEImage(); - if (mdImage != NULL) - { - layout = mdImage->GetLoadedLayout(); - pDir = &layout->GetCorHeader()->MetaData; + layout = mdImage->GetLoadedLayout(); - // In IL image case, we do not have any hint to IL metadata since it is stored - // in the corheader. - // - dwRvaHint = 0; - dwDataSize = pDir->Size; - } - else - { - return false; - } + // In IL image case, we do not have any hint to IL metadata since it is stored + // in the corheader. + // + dwRvaHint = 0; + dwDataSize = layout->GetCorHeader()->MetaData.Size; + } + else + { + return false; } // Do not fail if path can not be read. Triage dumps don't have paths and we want to fallback