summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Instruction/ARM/EmulationStateARM.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Plugins/Instruction/ARM/EmulationStateARM.cpp')
-rw-r--r--lldb/source/Plugins/Instruction/ARM/EmulationStateARM.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/lldb/source/Plugins/Instruction/ARM/EmulationStateARM.cpp b/lldb/source/Plugins/Instruction/ARM/EmulationStateARM.cpp
index 9ceeb76c6f5..7b10f8ffadb 100644
--- a/lldb/source/Plugins/Instruction/ARM/EmulationStateARM.cpp
+++ b/lldb/source/Plugins/Instruction/ARM/EmulationStateARM.cpp
@@ -192,15 +192,18 @@ size_t EmulationStateARM::WritePseudoMemory(
EmulationStateARM *pseudo_state = (EmulationStateARM *)baton;
if (length <= 4) {
- uint32_t value = *((const uint32_t *)dst);
+ uint32_t value;
+ memcpy (&value, dst, sizeof (uint32_t));
if (endian::InlHostByteOrder() == lldb::eByteOrderBig)
value = llvm::ByteSwap_32(value);
pseudo_state->StoreToPseudoAddress(addr, value);
return length;
} else if (length == 8) {
- uint32_t value1 = ((const uint32_t *)dst)[0];
- uint32_t value2 = ((const uint32_t *)dst)[1];
+ uint32_t value1;
+ uint32_t value2;
+ memcpy (&value1, dst, sizeof (uint32_t));
+ memcpy (&value2, (uint8_t *) dst + sizeof (uint32_t), sizeof (uint32_t));
if (endian::InlHostByteOrder() == lldb::eByteOrderBig) {
value1 = llvm::ByteSwap_32(value1);
value2 = llvm::ByteSwap_32(value2);
OpenPOWER on IntegriCloud