MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / solvegotos

Function solvegotos

lib/lua/src/lparser.c:585–598  ·  view source on GitHub ↗

** Solves forward jumps. Check whether new label 'lb' matches any ** pending gotos in current block and solves them. Return true ** if any of the gotos need to close upvalues. */

Source from the content-addressed store, hash-verified

583** if any of the gotos need to close upvalues.
584*/
585static int solvegotos (LexState *ls, Labeldesc *lb) {
586 Labellist *gl = &ls->dyd->gt;
587 int i = ls->fs->bl->firstgoto;
588 int needsclose = 0;
589 while (i < gl->n) {
590 if (eqstr(gl->arr[i].name, lb->name)) {
591 needsclose |= gl->arr[i].close;
592 solvegoto(ls, i, lb); /* will remove 'i' from the list */
593 }
594 else
595 i++;
596 }
597 return needsclose;
598}
599
600
601/*

Callers 1

createlabelFunction · 0.85

Calls 1

solvegotoFunction · 0.85

Tested by

no test coverage detected