Skip to content

Commit

Permalink
Implement fix in DNMD for dotnet/runtime#108907 (#56)
Browse files Browse the repository at this point in the history
Co-authored-by: Aaron Robinson <[email protected]>
  • Loading branch information
jkoritzinsky and AaronRobinsonMSFT authored Oct 16, 2024
1 parent 9e7cd7e commit daba646
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/interfaces/importhelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -602,13 +602,15 @@ 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
{
Expand Down Expand Up @@ -648,7 +650,7 @@ namespace
flags,
assemblyName,
assemblyCulture,
{ publicKeyToken.data(), publicKeyToken.size() },
publicKeyTokenSpan,
targetAssembly));

if (hr == S_OK)
Expand Down

0 comments on commit daba646

Please sign in to comment.