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

Function MCInst_handleWriteback

MCInst.c:225–250  ·  view source on GitHub ↗

Checks if tied operands exist in the instruction and sets - The writeback flag in detail - Saves the indices of the tied destination operands.

Source from the content-addressed store, hash-verified

223/// - The writeback flag in detail
224/// - Saves the indices of the tied destination operands.
225void MCInst_handleWriteback(MCInst *MI, const MCInstrDesc *InstDesc)
226{
227 const MCOperandInfo *OpInfo = InstDesc[MCInst_getOpcode(MI)].OpInfo;
228 unsigned short NumOps = InstDesc[MCInst_getOpcode(MI)].NumOperands;
229
230 unsigned i;
231 for (i = 0; i < NumOps; ++i) {
232 if (MCOperandInfo_isTiedToOp(&OpInfo[i])) {
233 int idx = MCOperandInfo_getOperandConstraint(
234 &InstDesc[MCInst_getOpcode(MI)], i,
235 MCOI_TIED_TO);
236
237 if (idx == -1)
238 continue;
239
240 if (i >= MAX_MC_OPS) {
241 assert(0 &&
242 "Maximum number of MC operands reached.");
243 }
244 MI->tied_op_idx[i] = idx;
245
246 if (MI->flat_insn->detail)
247 MI->flat_insn->detail->writeback = true;
248 }
249 }
250}
251
252/// Check if operand with OpNum is tied by another operand
253/// (operand is tying destination).

Callers

nothing calls this directly

Calls 3

MCInst_getOpcodeFunction · 0.85
MCOperandInfo_isTiedToOpFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…