** 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'. */
| 1114 | ** and removing the 'not'. |
| 1115 | */ |
| 1116 | static int jumponcond (FuncState *fs, expdesc *e, int cond) { |
| 1117 | if (e->k == VRELOC) { |
| 1118 | Instruction ie = getinstruction(fs, e); |
| 1119 | if (GET_OPCODE(ie) == OP_NOT) { |
| 1120 | removelastinstruction(fs); /* remove previous OP_NOT */ |
| 1121 | return condjump(fs, OP_TEST, GETARG_B(ie), 0, 0, !cond); |
| 1122 | } |
| 1123 | /* else go through */ |
| 1124 | } |
| 1125 | discharge2anyreg(fs, e); |
| 1126 | freeexp(fs, e); |
| 1127 | return condjump(fs, OP_TESTSET, NO_REG, e->u.info, 0, cond); |
| 1128 | } |
| 1129 | |
| 1130 | |
| 1131 | /* |
no test coverage detected