Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/runtime.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/coreclr/vm/peimagelayout.cpp')
-rw-r--r--src/coreclr/vm/peimagelayout.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/coreclr/vm/peimagelayout.cpp b/src/coreclr/vm/peimagelayout.cpp
index 2cf519425da..792a3176eb1 100644
--- a/src/coreclr/vm/peimagelayout.cpp
+++ b/src/coreclr/vm/peimagelayout.cpp
@@ -85,16 +85,18 @@ PEImageLayout* PEImageLayout::LoadConverted(PEImage* pOwner)
// ConvertedImageLayout may be able to handle them, but the fact that we were unable to
// load directly implies that MAPMapPEFile could not consume what crossgen produced.
// that is suspicious, one or another might have a bug.
- _ASSERTE(!pFlat->HasReadyToRunHeader());
+ _ASSERTE(!pOwner->IsFile() || !pFlat->HasReadyToRunHeader());
#endif
- if (!pFlat->HasReadyToRunHeader() && !pFlat->HasWriteableSections())
+ // ignore R2R if the image is not a file.
+ if ((pFlat->HasReadyToRunHeader() && pOwner->IsFile()) ||
+ pFlat->HasWriteableSections())
{
- // we can use flat layout for this
- return pFlat.Extract();
+ return new ConvertedImageLayout(pFlat);
}
- return new ConvertedImageLayout(pFlat);
+ // we can use flat layout for this
+ return pFlat.Extract();
}
PEImageLayout* PEImageLayout::Load(PEImage* pOwner, HRESULT* loadFailure)
@@ -448,7 +450,7 @@ ConvertedImageLayout::ConvertedImageLayout(FlatImageLayout* source)
IfFailThrow(Init(loadedImage));
- if (IsNativeMachineFormat() && g_fAllowNativeImages)
+ if (m_pOwner->IsFile() && IsNativeMachineFormat() && g_fAllowNativeImages)
{
// Do base relocation and exception hookup, if necessary.
// otherwise R2R will be disabled for this image.