Merge branch 'next' of github.com:aquynh/capstone into next
diff --git a/arch/EVM/EVMDisassembler.c b/arch/EVM/EVMDisassembler.c
index f9a9915..5cc8ff0 100644
--- a/arch/EVM/EVMDisassembler.c
+++ b/arch/EVM/EVMDisassembler.c
@@ -315,6 +315,8 @@
// setup groups
switch(opcode) {
+ default:
+ break;
case EVM_INS_ADD:
case EVM_INS_MUL:
case EVM_INS_SUB:
diff --git a/arch/EVM/EVMMapping.c b/arch/EVM/EVMMapping.c
index 1e0881c..3894089 100644
--- a/arch/EVM/EVMMapping.c
+++ b/arch/EVM/EVMMapping.c
@@ -16,8 +16,8 @@
};
#endif
-// look for @id in @insns, given its size in @max. first time call will update @cache.
-// return 0 if not found
+// look for @id in @insns, given its size in @max.
+// return -1 if not found
static int evm_insn_find(cs_evm *insns, unsigned int max, unsigned int id)
{
if (id >= max)
@@ -35,14 +35,9 @@
{
insn->id = id;
#ifndef CAPSTONE_DIET
- int i = evm_insn_find(insns, ARR_SIZE(insns), id);
- //printf(">> id = %u\n", id);
- if (i >= 0) {
+ if (evm_insn_find(insns, ARR_SIZE(insns), id) > 0) {
if (h->detail) {
- cs_struct handle;
- handle.detail = h->detail;
-
- memcpy(&insn->detail->evm, &insns[i], sizeof(insns[i]));
+ memcpy(&insn->detail->evm, &insns[id], sizeof(insns[id]));
}
}
#endif
@@ -328,8 +323,6 @@
{ EVM_GRP_JUMP, "jump" },
// special groups
{ EVM_GRP_MATH, "math" },
-
- { EVM_GRP_MATH, "math" },
{ EVM_GRP_STACK_WRITE, "stack_write" },
{ EVM_GRP_STACK_READ, "stack_read" },
{ EVM_GRP_MEM_WRITE, "mem_write" },