diff options
author | Brian Carlstrom <bdc@google.com> | 2014-03-13 15:12:11 -0700 |
---|---|---|
committer | Brian Carlstrom <bdc@google.com> | 2014-03-13 15:12:11 -0700 |
commit | c2687ef3ef95c9888af885ec3fa1516b218906ff (patch) | |
tree | 79604605fc47c44f5bc6d65f3f32b39e71ea2e61 /disassembler/disassembler_arm.cc | |
parent | b9d50a9829b795932eac4cc50a99b4ce80b0ecb4 (diff) | |
download | art-c2687ef3ef95c9888af885ec3fa1516b218906ff.zip art-c2687ef3ef95c9888af885ec3fa1516b218906ff.tar.gz art-c2687ef3ef95c9888af885ec3fa1516b218906ff.tar.bz2 |
Avoid bus error from reading unaligned 64-bit literal
Change-Id: I5932f130e6a8d31e09ef615e8544ff0e1073ede9
Diffstat (limited to 'disassembler/disassembler_arm.cc')
-rw-r--r-- | disassembler/disassembler_arm.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/disassembler/disassembler_arm.cc b/disassembler/disassembler_arm.cc index c35edbb..2a966a3 100644 --- a/disassembler/disassembler_arm.cc +++ b/disassembler/disassembler_arm.cc @@ -720,7 +720,8 @@ size_t DisassemblerArm::DumpThumb32(std::ostream& os, const uint8_t* instr_ptr) if (Rn.r == 15 && U == 1) { intptr_t lit_adr = reinterpret_cast<intptr_t>(instr_ptr); lit_adr = RoundDown(lit_adr, 4) + 4 + (imm8 << 2); - args << StringPrintf(" ; 0x%" PRIx64, *reinterpret_cast<int64_t*>(lit_adr)); + typedef const int64_t unaligned_int64_t __attribute__ ((aligned (2))); + args << StringPrintf(" ; 0x%" PRIx64, *reinterpret_cast<unaligned_int64_t*>(lit_adr)); } } else if (Rn.r == 13 && W == 1 && U == L) { // VPUSH/VPOP opcode << (L == 1 ? "vpop" : "vpush"); |