commit | e12e2de2cf9b0f5529ad91e9e4f1f13398d07f1a | [log] [tgz] |
---|---|---|
author | Nguyen Anh Quynh <aquynh@gmail.com> | Wed Jul 26 23:16:00 2017 +0800 |
committer | Nguyen Anh Quynh <aquynh@gmail.com> | Wed Jul 26 23:16:00 2017 +0800 |
tree | 190fbc05d202826d1f6e1511e9e74c67c65c57c3 | |
parent | cbf274c94c9234904f4a12b9a01d4bb2cb21dbc6 [diff] |
cstool: cs_op_count() can return -1. fix #978
diff --git a/cstool/cstool_x86.c b/cstool/cstool_x86.c index 05fb0c1..ae55162 100644 --- a/cstool/cstool_x86.c +++ b/cstool/cstool_x86.c
@@ -235,7 +235,7 @@ // Print out all immediate operands count = cs_op_count(ud, ins, X86_OP_IMM); - if (count) { + if (count > 0) { printf("\timm_count: %u\n", count); for (i = 1; i < count + 1; i++) { int index = cs_op_index(ud, ins, X86_OP_IMM, i);