** 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. */
| 507 | ** If it jumps into the scope of some variable, raises an error. |
| 508 | */ |
| 509 | static void solvegoto (LexState *ls, int g, Labeldesc *label) { |
| 510 | int i; |
| 511 | Labellist *gl = &ls->dyd->gt; /* list of goto's */ |
| 512 | Labeldesc *gt = &gl->arr[g]; /* goto to be resolved */ |
| 513 | lua_assert(eqstr(gt->name, label->name)); |
| 514 | if (unlikely(gt->nactvar < label->nactvar)) /* enter some scope? */ |
| 515 | jumpscopeerror(ls, gt); |
| 516 | luaK_patchlist(ls->fs, gt->pc, label->pc); |
| 517 | for (i = g; i < gl->n - 1; i++) /* remove goto from pending list */ |
| 518 | gl->arr[i] = gl->arr[i + 1]; |
| 519 | gl->n--; |
| 520 | } |
| 521 | |
| 522 | |
| 523 | /* |
no test coverage detected