<rdar://problem/11791234>
Remember to copy the address byte size and the byte order when copying data into a DWARF location object, or things will go wrong.
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@161721 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Expression/DWARFExpression.cpp b/source/Expression/DWARFExpression.cpp
index f42cc71..d1b65a5 100644
--- a/source/Expression/DWARFExpression.cpp
+++ b/source/Expression/DWARFExpression.cpp
@@ -264,7 +264,12 @@
DWARFExpression::CopyOpcodeData (const DataExtractor& data, uint32_t data_offset, uint32_t data_length)
{
const uint8_t *bytes = data.PeekData(data_offset, data_length);
- m_data.SetData(DataBufferSP(new DataBufferHeap(bytes, data_length)));
+ if (bytes)
+ {
+ m_data.SetData(DataBufferSP(new DataBufferHeap(bytes, data_length)));
+ m_data.SetByteOrder(data.GetByteOrder());
+ m_data.SetAddressByteSize(data.GetAddressByteSize());
+ }
}
void