** Solves the goto at index 'g' to given 'label' and removes it ** from the list of pending goto's. ** If it jumps into the scope of some variable, raises an error. */
| 513 | ** If it jumps into the scope of some variable, raises an error. |
| 514 | */ |
| 515 | static void solvegoto (LexState *ls, int g, Labeldesc *label) { |
| 516 | int i; |
| 517 | Labellist *gl = &ls->dyd->gt; /* list of goto's */ |
| 518 | Labeldesc *gt = &gl->arr[g]; /* goto to be resolved */ |
| 519 | lua_assert(eqstr(gt->name, label->name)); |
| 520 | if (l_unlikely(gt->nactvar < label->nactvar)) /* enter some scope? */ |
| 521 | jumpscopeerror(ls, gt); |
| 522 | luaK_patchlist(ls->fs, gt->pc, label->pc); |
| 523 | for (i = g; i < gl->n - 1; i++) /* remove goto from pending list */ |
| 524 | gl->arr[i] = gl->arr[i + 1]; |
| 525 | gl->n--; |
| 526 | } |
| 527 | |
| 528 | |
| 529 | /* |
no test coverage detected