For microinstructions with two or more operands (in l and r), check to see if one of them is numeric and the other one isn't. If this is the case, return pointers to the operands in the appropriately-named argument variables and return true. Otherwise, return false.
| 23 | // For microinstructions with two or more operands (in l and r), check to see if one of them is numeric and the other one isn't. |
| 24 | // If this is the case, return pointers to the operands in the appropriately-named argument variables and return true. Otherwise, return false. |
| 25 | bool ExtractNumAndNonNum(minsn_t* insn, mop_t*& numOp, mop_t*& otherOp) |
| 26 | { |
| 27 | mop_t* num = NULL, * other = NULL; |
| 28 | |
| 29 | //check right hand before |
| 30 | if (insn->r.t == mop_n) { |
| 31 | num = &insn->r; |
| 32 | other = &insn->l; |
| 33 | } |
| 34 | |
| 35 | //check left hand only for commutative ops |
| 36 | if (insn->opcode != m_sub) { |
| 37 | if (insn->l.t == mop_n) { |
| 38 | if (num != NULL) { |
| 39 | // Technically we have an option to perform constant folding here... but Hex-Rays should have done / should do that for us |
| 40 | return false; |
| 41 | } |
| 42 | num = &insn->l; |
| 43 | other = &insn->r; |
| 44 | } |
| 45 | } |
| 46 | if (num == NULL) |
| 47 | return false; |
| 48 | |
| 49 | numOp = num; |
| 50 | otherOp = other; |
| 51 | return true; |
| 52 | } |
| 53 | |
| 54 | // For microinstructions with two or more operands (in l and r), check to see |
| 55 | // if one of them is a mop_d (result of another microinstruction), where the |
no outgoing calls
no test coverage detected