MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / solvegoto

Function solvegoto

extlibs/lua/src/lparser.c:509–520  ·  view source on GitHub ↗

** 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. */

Source from the content-addressed store, hash-verified

507** If it jumps into the scope of some variable, raises an error.
508*/
509static 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/*

Callers 1

solvegotosFunction · 0.85

Calls 2

jumpscopeerrorFunction · 0.85
luaK_patchlistFunction · 0.85

Tested by

no test coverage detected