| 4057 | |
| 4058 | |
| 4059 | static void exp2reg (FuncState *fs, expdesc *e, int reg) { |
| 4060 | discharge2reg(fs, e, reg); |
| 4061 | if (e->k == VJMP) |
| 4062 | luaK_concat(fs, &e->t, e->u.s.info); /* put this jump in `t' list */ |
| 4063 | if (hasjumps(e)) { |
| 4064 | int final; /* position after whole expression */ |
| 4065 | int p_f = NO_JUMP; /* position of an eventual LOAD false */ |
| 4066 | int p_t = NO_JUMP; /* position of an eventual LOAD true */ |
| 4067 | if (need_value(fs, e->t) || need_value(fs, e->f)) { |
| 4068 | int fj = (e->k == VJMP) ? NO_JUMP : luaK_jump(fs); |
| 4069 | p_f = code_label(fs, reg, 0, 1); |
| 4070 | p_t = code_label(fs, reg, 1, 0); |
| 4071 | luaK_patchtohere(fs, fj); |
| 4072 | } |
| 4073 | final = luaK_getlabel(fs); |
| 4074 | patchlistaux(fs, e->f, final, reg, p_f); |
| 4075 | patchlistaux(fs, e->t, final, reg, p_t); |
| 4076 | } |
| 4077 | e->f = e->t = NO_JUMP; |
| 4078 | e->u.s.info = reg; |
| 4079 | e->k = VNONRELOC; |
| 4080 | } |
| 4081 | |
| 4082 | |
| 4083 | void luaK_exp2nextreg (FuncState *fs, expdesc *e) { |
no test coverage detected