From f8e783f1662812a0a417e463f1ea646c96bb0743 Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Wed, 1 Feb 2023 23:19:35 -0600 Subject: [PATCH] [DX] Speculative fix for big endian encoding I missed byte swapping the size field. --- llvm/lib/MC/DXContainerPSVInfo.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/llvm/lib/MC/DXContainerPSVInfo.cpp b/llvm/lib/MC/DXContainerPSVInfo.cpp index 5463f85..399f54c 100644 --- a/llvm/lib/MC/DXContainerPSVInfo.cpp +++ b/llvm/lib/MC/DXContainerPSVInfo.cpp @@ -26,6 +26,8 @@ void PSVRuntimeInfo::write(raw_ostream &OS, uint32_t Version) const { default: InfoSize = sizeof(dxbc::PSV::v2::RuntimeInfo); } + if (sys::IsBigEndianHost) + sys::swapByteOrder(InfoSize); // Write the size of the info. OS.write(reinterpret_cast(&InfoSize), sizeof(uint32_t)); // Write the info itself. -- 2.7.4