Skip to content

Commit

Permalink
Fix ilasm /mdv option (dotnet#101086)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkotas authored and matouskozak committed Apr 30, 2024
1 parent b9ead90 commit dec42e7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/coreclr/ilasm/writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ HRESULT Assembler::InitMetaData()
if (FAILED(hr))
goto exit;

if(m_wzMetadataVersion)
{
VARIANT optionValue;
V_VT(&optionValue) = VT_BSTR;
V_BSTR(&optionValue) = m_wzMetadataVersion; // IMetaDataDispenserEx does not require proper BSTR
hr = m_pDisp->SetOption(MetaDataRuntimeVersion, &optionValue);
}

hr = m_pDisp->DefineScope(CLSID_CorMetaDataRuntime, 0, IID_IMetaDataEmit3,
(IUnknown **)&m_pEmitter);
if (FAILED(hr))
Expand Down

0 comments on commit dec42e7

Please sign in to comment.