** Emit instruction to jump if 'e' is 'cond' (that is, if 'cond' ** is true, code will jump if 'e' is true.) Return jump position. ** Optimize when 'e' is 'not' something, inverting the condition ** and removing the 'not'. */
| 1096 | ** and removing the 'not'. |
| 1097 | */ |
| 1098 | static int jumponcond (FuncState *fs, expdesc *e, int cond) { |
| 1099 | if (e->k == VRELOC) { |
| 1100 | Instruction ie = getinstruction(fs, e); |
| 1101 | if (GET_OPCODE(ie) == OP_NOT) { |
| 1102 | removelastinstruction(fs); /* remove previous OP_NOT */ |
| 1103 | return condjump(fs, OP_TEST, GETARG_B(ie), 0, 0, !cond); |
| 1104 | } |
| 1105 | /* else go through */ |
| 1106 | } |
| 1107 | discharge2anyreg(fs, e); |
| 1108 | freeexp(fs, e); |
| 1109 | return condjump(fs, OP_TESTSET, NO_REG, e->u.info, 0, cond); |
| 1110 | } |
| 1111 | |
| 1112 | |
| 1113 | /* |
no test coverage detected