Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/coreclr/src/vm/ceeload.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ uint32_t Module::GetNativeMetadataAssemblyCount()
NativeImage *compositeImage = GetCompositeNativeImage();
if (compositeImage != NULL)
{
return compositeImage->GetComponentAssemblyCount();
return compositeImage->GetManifestAssemblyCount();
}
else
{
Expand Down
13 changes: 9 additions & 4 deletions src/coreclr/src/vm/nativeimage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,19 @@ void NativeImage::Initialize(READYTORUN_HEADER *pHeader, LoaderAllocator *pLoade
HENUMInternal assemblyEnum;
HRESULT hr = m_pManifestMetadata->EnumAllInit(mdtAssemblyRef, &assemblyEnum);
mdAssemblyRef assemblyRef;
int assemblyIndex = 0;
m_manifestAssemblyCount = 0;
while (m_pManifestMetadata->EnumNext(&assemblyEnum, &assemblyRef))
{
LPCSTR assemblyName;
hr = m_pManifestMetadata->GetAssemblyRefProps(assemblyRef, NULL, NULL, &assemblyName, NULL, NULL, NULL, NULL);
m_assemblySimpleNameToIndexMap.Add(AssemblyNameIndex(assemblyName, assemblyIndex));
assemblyIndex++;
m_assemblySimpleNameToIndexMap.Add(AssemblyNameIndex(assemblyName, m_manifestAssemblyCount));
m_manifestAssemblyCount++;
}

// When a composite image contributes to a larger version bubble, its manifest assembly
// count may exceed its component assembly count as it may contain references to
// assemblies outside of the composite image that are part of its version bubble.
_ASSERTE(m_manifestAssemblyCount >= m_componentAssemblyCount);
}

NativeImage::~NativeImage()
Expand Down Expand Up @@ -115,7 +120,7 @@ NativeImage *NativeImage::Open(
#endif

#ifndef DACCESS_COMPILE
Assembly *NativeImage::LoadComponentAssembly(uint32_t rowid)
Assembly *NativeImage::LoadManifestAssembly(uint32_t rowid)
{
STANDARD_VM_CONTRACT;

Expand Down
4 changes: 3 additions & 1 deletion src/coreclr/src/vm/nativeimage.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class NativeImage

IMAGE_DATA_DIRECTORY *m_pComponentAssemblies;
uint32_t m_componentAssemblyCount;
uint32_t m_manifestAssemblyCount;
SHash<AssemblyNameIndexHashTraits> m_assemblySimpleNameToIndexMap;

Crst m_eagerFixupsLock;
Expand Down Expand Up @@ -93,8 +94,9 @@ class NativeImage
uint32_t GetComponentAssemblyCount() const { return m_componentAssemblyCount; }
ReadyToRunInfo *GetReadyToRunInfo() const { return m_pReadyToRunInfo; }
IMDInternalImport *GetManifestMetadata() const { return m_pManifestMetadata; }
uint32_t GetManifestAssemblyCount() const { return m_manifestAssemblyCount; }

Assembly *LoadComponentAssembly(uint32_t rowid);
Assembly *LoadManifestAssembly(uint32_t rowid);

PTR_READYTORUN_CORE_HEADER GetComponentAssemblyHeader(LPCUTF8 assemblySimpleName);

Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/src/vm/zapsig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ Module *ZapSig::DecodeModuleFromIndex(Module *fromModule,
{
if (nativeImage != NULL)
{
pAssembly = nativeImage->LoadComponentAssembly(index);
pAssembly = nativeImage->LoadManifestAssembly(index);
}
else
{
Expand Down