[DX] Speculative fix for big endian encoding
authorChris Bieneman <chris.bieneman@me.com>
Thu, 2 Feb 2023 05:19:35 +0000 (23:19 -0600)
committerChris Bieneman <chris.bieneman@me.com>
Thu, 2 Feb 2023 05:19:35 +0000 (23:19 -0600)
I missed byte swapping the size field.

llvm/lib/MC/DXContainerPSVInfo.cpp

index 5463f85..399f54c 100644 (file)
@@ -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<const char *>(&InfoSize), sizeof(uint32_t));
   // Write the info itself.