From: Benjamin Kramer Date: Tue, 7 Jun 2022 14:29:06 +0000 (+0200) Subject: [DX][ObjYAML] Zero out unused fields that get written to the output file X-Git-Tag: upstream/15.0.7~5648 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1fd0beaa4e20be0eb63b5eed10e021ad7c0d0c26;p=platform%2Fupstream%2Fllvm.git [DX][ObjYAML] Zero out unused fields that get written to the output file Found by msan --- diff --git a/llvm/lib/ObjectYAML/DXContainerEmitter.cpp b/llvm/lib/ObjectYAML/DXContainerEmitter.cpp index 260e059..9834b03 100644 --- a/llvm/lib/ObjectYAML/DXContainerEmitter.cpp +++ b/llvm/lib/ObjectYAML/DXContainerEmitter.cpp @@ -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)