Skip to content

Commit

Permalink
Implement fix in DNMD for dotnet/runtime#108907
Browse files Browse the repository at this point in the history
  • Loading branch information
jkoritzinsky committed Oct 15, 2024
1 parent 9e7cd7e commit 1b96e8b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/interfaces/importhelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -602,17 +602,20 @@ namespace
uint32_t publicKeyLength;
if (1 != md_get_column_value_as_blob(sourceAssembly, mdtAssembly_PublicKey, 1, &publicKey, &publicKeyLength))
return E_FAIL;


span<const uint8_t> publicKeyTokenSpan;
StrongNameToken publicKeyToken;
if (publicKey != nullptr)
{
assert(IsAfPublicKey(flags));
flags &= ~afPublicKey;
RETURN_IF_FAILED(StrongNameTokenFromPublicKey({ publicKey, publicKeyLength }, publicKeyToken));
publicKeyTokenSpan = { publicKeyToken.data(), publicKeyToken.size() };
}
else
{
assert(!IsAfPublicKey(flags));
publicKeyTokenSpan = { nullptr, 0 };
}

uint32_t majorVersion;
Expand Down Expand Up @@ -648,7 +651,7 @@ namespace
flags,
assemblyName,
assemblyCulture,
{ publicKeyToken.data(), publicKeyToken.size() },
publicKeyTokenSpan,
targetAssembly));

if (hr == S_OK)
Expand Down

0 comments on commit 1b96e8b

Please sign in to comment.