[ORC] Fix endianness in manual serialization to match WrapperFunctionUtils.

This commit is contained in:
Lang Hames 2021-06-15 21:51:52 +10:00
parent 0672d5d104
commit 89fa1a3a83
2 changed files with 8 additions and 3 deletions

View File

@ -25,7 +25,8 @@ writeDebugObjectInfo(sys::MemoryBlock TargetMemBlock) {
ArgBuffer.resize(sizeof(decltype(DebugObjAddr)) +
sizeof(decltype(DebugObjSize)));
BinaryStreamWriter ArgWriter(ArgBuffer, support::endianness::big);
// FIXME: Replace manual serializatio with WrapperFunction utility.
BinaryStreamWriter ArgWriter(ArgBuffer, support::endianness::little);
cantFail(ArgWriter.writeInteger(DebugObjAddr));
cantFail(ArgWriter.writeInteger(DebugObjSize));

View File

@ -54,9 +54,11 @@ Error TPCEHFrameRegistrar::registerEHFrames(JITTargetAddress EHFrameSectionAddr,
size_t EHFrameSectionSize) {
constexpr size_t ArgBufferSize = sizeof(uint64_t) + sizeof(uint64_t);
uint8_t ArgBuffer[ArgBufferSize];
// FIXME: Replace manual serialization with WrapperFunction util call.
BinaryStreamWriter ArgWriter(
MutableArrayRef<uint8_t>(ArgBuffer, ArgBufferSize),
support::endianness::big);
support::endianness::little);
cantFail(ArgWriter.writeInteger(static_cast<uint64_t>(EHFrameSectionAddr)));
cantFail(ArgWriter.writeInteger(static_cast<uint64_t>(EHFrameSectionSize)));
@ -67,9 +69,11 @@ Error TPCEHFrameRegistrar::deregisterEHFrames(
JITTargetAddress EHFrameSectionAddr, size_t EHFrameSectionSize) {
constexpr size_t ArgBufferSize = sizeof(uint64_t) + sizeof(uint64_t);
uint8_t ArgBuffer[ArgBufferSize];
// FIXME: Replace manual serialization with WrapperFunction util call.
BinaryStreamWriter ArgWriter(
MutableArrayRef<uint8_t>(ArgBuffer, ArgBufferSize),
support::endianness::big);
support::endianness::little);
cantFail(ArgWriter.writeInteger(static_cast<uint64_t>(EHFrameSectionAddr)));
cantFail(ArgWriter.writeInteger(static_cast<uint64_t>(EHFrameSectionSize)));