[DX][ObjYAML] Zero out unused fields that get written to the output file

Found by msan
This commit is contained in:
Benjamin Kramer 2022-06-07 16:29:06 +02:00
parent 59328ab0ce
commit 1fd0beaa4e
1 changed files with 2 additions and 0 deletions

View File

@ -124,10 +124,12 @@ void DXContainerWriter::writeParts(raw_ostream &OS) {
dxbc::ProgramHeader Header;
Header.MajorVersion = P.Program->MajorVersion;
Header.MinorVersion = P.Program->MinorVersion;
Header.Unused = 0;
Header.ShaderKind = P.Program->ShaderKind;
memcpy(Header.Bitcode.Magic, "DXIL", 4);
Header.Bitcode.MajorVersion = P.Program->DXILMajorVersion;
Header.Bitcode.MinorVersion = P.Program->DXILMinorVersion;
Header.Bitcode.Unused = 0;
// Compute the optional fields if needed...
if (P.Program->DXILOffset)