Copies the implicit write registers of @imap to @MI->flat_insn. Already present registers will be preserved.
| 113 | /// Copies the implicit write registers of @imap to @MI->flat_insn. |
| 114 | /// Already present registers will be preserved. |
| 115 | void 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. |
no test coverage detected
searching dependent graphs…