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

Function solvegoto

xrepo/packages/l/lua/port/lua/src/lparser.c:526–537  ·  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

524** If it jumps into the scope of some variable, raises an error.
525*/
526static void solvegoto (LexState *ls, int g, Labeldesc *label) {
527 int i;
528 Labellist *gl = &ls->dyd->gt; /* list of goto's */
529 Labeldesc *gt = &gl->arr[g]; /* goto to be resolved */
530 lua_assert(eqstr(gt->name, label->name));
531 if (l_unlikely(gt->nactvar < label->nactvar)) /* enter some scope? */
532 jumpscopeerror(ls, gt);
533 luaK_patchlist(ls->fs, gt->pc, label->pc);
534 for (i = g; i < gl->n - 1; i++) /* remove goto from pending list */
535 gl->arr[i] = gl->arr[i + 1];
536 gl->n--;
537}
538
539
540/*

Callers 1

solvegotosFunction · 0.85

Calls 2

jumpscopeerrorFunction · 0.85
luaK_patchlistFunction · 0.85

Tested by

no test coverage detected