Skip to content

Commit 19f96a9

Browse files
authored
[DirectX][ObjectYAML] Fix SRCI Names parsing on Big Endian (#202020)
``` Names.Parameters = HeaderOnDisk; ``` converts SRCI Names section header from little endian to platform native byte order (in converting constructor). Therefore, extra ``` if (sys::IsBigEndianHost) Names.Parameters.swapBytes(); ``` can swap bytes of the header fields again, causing an error on SPARC: ``` SRCI Names section content ends beyond the section boundary ``` Fix that.
1 parent 3232b4d commit 19f96a9

1 file changed

Lines changed: 0 additions & 2 deletions

File tree

llvm/lib/Object/DXContainer.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,6 @@ static Expected<size_t> parseNames(StringRef Section,
228228
HeaderOnDisk))
229229
return Err;
230230
Names.Parameters = HeaderOnDisk;
231-
if (sys::IsBigEndianHost)
232-
Names.Parameters.swapBytes();
233231
Current += sizeof(HeaderOnDisk);
234232

235233
if (Names.Parameters.Flags)

0 commit comments

Comments
 (0)