commit | 11b05193ec27eb62d2f0d44807a692b31cd9c0cc | [log] [tgz] |
---|---|---|
author | Nguyen Anh Quynh <aquynh@gmail.com> | Wed Jan 22 11:04:25 2014 +0800 |
committer | Nguyen Anh Quynh <aquynh@gmail.com> | Wed Jan 22 11:06:34 2014 +0800 |
tree | a7ed065ac4f2a9e83947431bcbd18cf07e997dcd | |
parent | 9162aa1756908b8f8a4271f630ce643c00b9a2ae [diff] [blame] |
reset prev_prefix at the entry of cs_disasm_ex(). this fixes a nasty segfault bug
diff --git a/cs.c b/cs.c index c2ed6bd..12af4ae 100644 --- a/cs.c +++ b/cs.c
@@ -309,6 +309,9 @@ handle->errnum = CS_ERR_OK; + // reset previous prefix for X86 + handle->prev_prefix = 0; + memset(insn_cache, 0, sizeof(insn_cache)); while (size > 0) {