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

Function map_implicit_writes

Mapping.c:115–136  ·  view source on GitHub ↗

Copies the implicit write registers of @imap to @MI->flat_insn. Already present registers will be preserved.

Source from the content-addressed store, hash-verified

113/// Copies the implicit write registers of @imap to @MI->flat_insn.
114/// Already present registers will be preserved.
115void map_implicit_writes(MCInst *MI, const insn_map *imap)
116{
117#ifndef CAPSTONE_DIET
118 if (!MI->flat_insn->detail)
119 return;
120
121 cs_detail *detail = MI->flat_insn->detail;
122 unsigned Opcode = MCInst_getOpcode(MI);
123 unsigned i = 0;
124 uint16_t reg = imap[Opcode].regs_mod[i];
125 while (reg != 0) {
126 if (i >= MAX_IMPL_W_REGS ||
127 detail->regs_write_count >= MAX_IMPL_W_REGS) {
128 printf("ERROR: Too many implicit write register defined in "
129 "instruction mapping.\n");
130 return;
131 }
132 detail->regs_write[detail->regs_write_count++] = reg;
133 reg = imap[Opcode].regs_mod[++i];
134 }
135#endif // CAPSTONE_DIET
136}
137
138/// Copies the groups from @imap to @MI->flat_insn.
139/// Already present groups will be preserved.

Callers 1

Calls 2

MCInst_getOpcodeFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…