[llvm] 19f96a9 - [DirectX][ObjectYAML] Fix SRCI Names parsing on Big Endian (#202020)
via llvm-commits
llvm-commits at lists.llvm.org
Sat Jun 6 13:22:42 PDT 2026
Author: Vladislav Dzhidzhoev
Date: 2026-06-06T22:22:38+02:00
New Revision: 19f96a9c433bf268b1ca8aee3eca976591d8a9b8
URL: https://github.com/llvm/llvm-project/commit/19f96a9c433bf268b1ca8aee3eca976591d8a9b8
DIFF: https://github.com/llvm/llvm-project/commit/19f96a9c433bf268b1ca8aee3eca976591d8a9b8.diff
LOG: [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.
Added:
Modified:
llvm/lib/Object/DXContainer.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Object/DXContainer.cpp b/llvm/lib/Object/DXContainer.cpp
index 2e715f0bab3e1..d37eb4833113d 100644
--- a/llvm/lib/Object/DXContainer.cpp
+++ b/llvm/lib/Object/DXContainer.cpp
@@ -228,8 +228,6 @@ static Expected<size_t> parseNames(StringRef Section,
HeaderOnDisk))
return Err;
Names.Parameters = HeaderOnDisk;
- if (sys::IsBigEndianHost)
- Names.Parameters.swapBytes();
Current += sizeof(HeaderOnDisk);
if (Names.Parameters.Flags)
More information about the llvm-commits
mailing list