Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 47bef69

Browse files

File tree

7 files changed

+7
-77
lines changed

7 files changed

+7
-77
lines changed
 

‎src/debug/daccess/nidump.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ NativeImageDumper::DumpNativeImage()
720720

721721
for (COUNT_T i = 0; i < m_decoder.GetNumberOfSections(); i++)
722722
{
723-
PTR_IMAGE_SECTION_HEADER section = m_decoder.FindFirstSection() + i;
723+
PTR_IMAGE_SECTION_HEADER section = dptr_add(m_decoder.FindFirstSection(), i);
724724
m_display->Section(reinterpret_cast<char *>(section->Name),
725725
section->VirtualAddress,
726726
section->SizeOfRawData);

‎src/inc/pedecoder.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ class PEDecoder
182182
UINT32 GetWin32VersionValue() const;
183183
COUNT_T GetNumberOfRvaAndSizes() const;
184184
COUNT_T GetNumberOfSections() const;
185-
PTR_IMAGE_SECTION_HEADER FindFirstSection() const;
185+
IMAGE_SECTION_HEADER *FindFirstSection() const;
186186
IMAGE_SECTION_HEADER *FindSection(LPCSTR sectionName) const;
187187

188188
DWORD GetImageIdentity() const;

‎src/inc/pedecoder.inl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1178,7 +1178,7 @@ inline DWORD PEDecoder::GetImageIdentity() const
11781178
}
11791179

11801180

1181-
inline PTR_IMAGE_SECTION_HEADER PEDecoder::FindFirstSection() const
1181+
inline IMAGE_SECTION_HEADER *PEDecoder::FindFirstSection() const
11821182
{
11831183
CONTRACT(IMAGE_SECTION_HEADER *)
11841184
{

‎src/utilcode/pedecoder.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,6 @@ BOOL PEDecoder::HasWriteableSections() const
445445
CONTRACT_CHECK
446446
{
447447
INSTANCE_CHECK;
448-
PRECONDITION(CheckNTHeaders());
449448
PRECONDITION(CheckFormat());
450449
NOTHROW;
451450
GC_NOTRIGGER;
@@ -454,7 +453,7 @@ BOOL PEDecoder::HasWriteableSections() const
454453
}
455454
CONTRACT_CHECK_END;
456455

457-
PTR_IMAGE_SECTION_HEADER pSection = FindFirstSection();
456+
PTR_IMAGE_SECTION_HEADER pSection = FindFirstSection(FindNTHeaders());
458457
_ASSERTE(pSection != NULL);
459458

460459
PTR_IMAGE_SECTION_HEADER pSectionEnd = pSection + VAL16(FindNTHeaders()->FileHeader.NumberOfSections);

‎src/vm/peimage.cpp

+3-4
Original file line numberDiff line numberDiff line change
@@ -1029,9 +1029,7 @@ PTR_PEImageLayout PEImage::CreateLayoutFlat(BOOL bPermitWriteableSections)
10291029

10301030
PTR_PEImageLayout pFlatLayout = PEImageLayout::LoadFlat(GetFileHandle(),this);
10311031

1032-
if (!bPermitWriteableSections
1033-
&& pFlatLayout->CheckNTHeaders()
1034-
&& pFlatLayout->HasWriteableSections())
1032+
if (!bPermitWriteableSections && pFlatLayout->HasWriteableSections())
10351033
{
10361034
pFlatLayout->Release();
10371035

@@ -1116,7 +1114,8 @@ void PEImage::Load()
11161114

11171115
#ifdef PLATFORM_UNIX
11181116
if (m_pLayouts[IMAGE_FLAT] != NULL
1119-
&& m_pLayouts[IMAGE_FLAT]->CheckILOnlyFormat()
1117+
&& m_pLayouts[IMAGE_FLAT]->CheckFormat()
1118+
&& m_pLayouts[IMAGE_FLAT]->IsILOnly()
11201119
&& !m_pLayouts[IMAGE_FLAT]->HasWriteableSections())
11211120
{
11221121
// IL-only images with writeable sections are mapped in general way,

‎tests/src/Loader/regressions/GitHub_15544/main.cs

-37
This file was deleted.

‎tests/src/Loader/regressions/GitHub_15544/main.csproj

-31
This file was deleted.

0 commit comments

Comments
 (0)
This repository has been archived.