From 63547c70d4d23e0c8b48eb0e00b81100bd9aba20 Mon Sep 17 00:00:00 2001 From: David Callahan Date: Sun, 10 May 2015 16:39:15 -0700 Subject: [PATCH] fix setting writeback for post index memory accesses --- arch/AArch64/AArch64InstPrinter.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/arch/AArch64/AArch64InstPrinter.c b/arch/AArch64/AArch64InstPrinter.c index 113ae0ed5..09948c8b2 100644 --- a/arch/AArch64/AArch64InstPrinter.c +++ b/arch/AArch64/AArch64InstPrinter.c @@ -1379,8 +1379,15 @@ void AArch64_post_printer(csh handle, cs_insn *flat_insn, char *insn_asm, MCInst return; // check if this insn requests write-back - if (strrchr(insn_asm, '!') != NULL) + if (strrchr(insn_asm, '!') != NULL) { flat_insn->detail->arm64.writeback = true; + } else { + // check for post-index ... [reg], #offset + const char * lb = strrchr(insn_asm, ']'); + if (lb != NULL && lb[1] == ',') { + flat_insn->detail->arm64.writeback = true; + } + } } #endif