Coverage Report

Created: 2026-06-15 06:41

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/capstonenext/arch/WASM/WASMInstPrinter.c
Line
Count
Source
1
/* Capstone Disassembly Engine */
2
/* By Spike, xwings  2019 */
3
4
#include "WASMInstPrinter.h"
5
#include "WASMMapping.h"
6
7
void WASM_printInst(MCInst *MI, struct SStream *O, void *PrinterInfo)
8
61.1k
{
9
61.1k
  SStream_concat(O, WASM_insn_name((csh)MI->csh, MI->Opcode));
10
11
61.1k
  switch (MI->wasm_data.type) {
12
51.4k
  default:
13
51.4k
    break;
14
15
51.4k
  case WASM_OP_VARUINT32:
16
2.46k
    SStream_concat(O, "\t0x%x", MI->wasm_data.varuint32);
17
2.46k
    break;
18
19
538
  case WASM_OP_VARUINT64:
20
538
    SStream_concat(O, "\t0x%lx", MI->wasm_data.varuint64);
21
538
    break;
22
23
115
  case WASM_OP_UINT32:
24
115
    SStream_concat(O, "\t0x%2" PRIx32, MI->wasm_data.uint32);
25
115
    break;
26
27
28
  case WASM_OP_UINT64:
28
28
    SStream_concat(O, "\t0x%2" PRIx64, MI->wasm_data.uint64);
29
28
    break;
30
31
4.60k
  case WASM_OP_IMM:
32
4.60k
    SStream_concat(O, "\t0x%x, 0x%x", MI->wasm_data.immediate[0],
33
4.60k
             MI->wasm_data.immediate[1]);
34
4.60k
    break;
35
36
1.32k
  case WASM_OP_INT7:
37
1.32k
    SStream_concat(O, "\t%d", MI->wasm_data.int7);
38
1.32k
    break;
39
40
596
  case WASM_OP_BRTABLE:
41
596
    SStream_concat(O, "\t0x%x, [", MI->wasm_data.brtable.length);
42
596
    SStream_concat(O, "0x%x", MI->wasm_data.brtable.address);
43
596
    SStream_concat(O, "], 0x%x",
44
596
             MI->wasm_data.brtable.default_target);
45
46
596
    break;
47
61.1k
  }
48
61.1k
}