Skip to content

Commit 1fd0bea

Browse files
committed
[DX][ObjYAML] Zero out unused fields that get written to the output file
Found by msan
1 parent 59328ab commit 1fd0bea

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

llvm/lib/ObjectYAML/DXContainerEmitter.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,12 @@ void DXContainerWriter::writeParts(raw_ostream &OS) {
124124
dxbc::ProgramHeader Header;
125125
Header.MajorVersion = P.Program->MajorVersion;
126126
Header.MinorVersion = P.Program->MinorVersion;
127+
Header.Unused = 0;
127128
Header.ShaderKind = P.Program->ShaderKind;
128129
memcpy(Header.Bitcode.Magic, "DXIL", 4);
129130
Header.Bitcode.MajorVersion = P.Program->DXILMajorVersion;
130131
Header.Bitcode.MinorVersion = P.Program->DXILMinorVersion;
132+
Header.Bitcode.Unused = 0;
131133

132134
// Compute the optional fields if needed...
133135
if (P.Program->DXILOffset)

0 commit comments

Comments
 (0)