MCPcopy Create free account
hub / github.com/capstone-engine/capstone / map_add_implicit_write

Function map_add_implicit_write

Mapping.c:71–86  ·  view source on GitHub ↗

Adds a register to the implicit write register list. It will not add the same register twice.

Source from the content-addressed store, hash-verified

69/// Adds a register to the implicit write register list.
70/// It will not add the same register twice.
71void map_add_implicit_write(MCInst *MI, uint32_t Reg)
72{
73 if (!MI->flat_insn->detail)
74 return;
75
76 uint16_t *regs_write = MI->flat_insn->detail->regs_write;
77 for (int i = 0; i < MAX_IMPL_W_REGS; ++i) {
78 if (i == MI->flat_insn->detail->regs_write_count) {
79 regs_write[i] = Reg;
80 MI->flat_insn->detail->regs_write_count++;
81 return;
82 }
83 if (regs_write[i] == Reg)
84 return;
85 }
86}
87
88/// Copies the implicit read registers of @imap to @MI->flat_insn.
89/// Already present registers will be preserved.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…