From c1d2f1eeda55c8424604d4af2106eaf904cb551e Mon Sep 17 00:00:00 2001 From: Nguyen Anh Quynh Date: Wed, 27 Apr 2016 14:43:10 +0800 Subject: [PATCH] arm: reset IT block before cs_disasm(). this fixes issue #643 --- cs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cs.c b/cs.c index 36d578555..2e011ca04 100644 --- a/cs.c +++ b/cs.c @@ -562,6 +562,9 @@ size_t cs_disasm(csh ud, const uint8_t *buffer, size_t size, uint64_t offset, si handle->errnum = CS_ERR_OK; + // reset IT block of ARM structure + handle->ITBlock.size = 0; + #ifdef CAPSTONE_USE_SYS_DYN_MEM if (count > 0 && count <= INSN_CACHE_SIZE) cache_size = (unsigned int) count;