Skip to content

Commit

Permalink
Add missing switch-case in RAnal.wasm to fix a warning (#17038)
Browse files Browse the repository at this point in the history
Co-authored-by: pancake <pancake@nopcode.org>
  • Loading branch information
trufae and radare committed Jun 10, 2020
1 parent 9978bbd commit 26e23ee
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions libr/anal/p/anal_wasm.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* radare2 - LGPL - Copyright 2017-2019 - xvilka, deroad */
/* radare2 - LGPL - Copyright 2017-2020 - xvilka, deroad */

#include <string.h>
#include <r_types.h>
Expand Down Expand Up @@ -81,12 +81,15 @@ static int wasm_op(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *data, int len
op->sign = true;
op->type = R_ANAL_OP_TYPE_UNK;
switch (wop.type) {
case WASM_TYPE_OP_CORE:
op->id = wop.op.core;
break;
case WASM_TYPE_OP_ATOMIC:
op->id = (0xfe << 8) | wop.op.atomic;
break;
case WASM_TYPE_OP_CORE:
op->id = wop.op.core;
break;
case WASM_TYPE_OP_ATOMIC:
op->id = (0xfe << 8) | wop.op.atomic;
break;
case WASM_TYPE_OP_SIMD:
op->id = 0xfd;
break;
}

if (!wop.txt || !strncmp (wop.txt, "invalid", 7)) {
Expand Down

0 comments on commit 26e23ee

Please sign in to comment.