MCPcopy Create free account
hub / github.com/F-Stack/f-stack / closegoto

Function closegoto

freebsd/contrib/openzfs/module/lua/lparser.c:338–356  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

336
337
338static void closegoto (LexState *ls, int g, Labeldesc *label) {
339 int i;
340 FuncState *fs = ls->fs;
341 Labellist *gl = &ls->dyd->gt;
342 Labeldesc *gt = &gl->arr[g];
343 lua_assert(luaS_eqstr(gt->name, label->name));
344 if (gt->nactvar < label->nactvar) {
345 TString *vname = getlocvar(fs, gt->nactvar)->varname;
346 const char *msg = luaO_pushfstring(ls->L,
347 "<goto %s> at line %d jumps into the scope of local " LUA_QS,
348 getstr(gt->name), gt->line, getstr(vname));
349 semerror(ls, msg);
350 }
351 luaK_patchlist(fs, gt->pc, label->pc);
352 /* remove goto from pending list */
353 for (i = g; i < gl->n - 1; i++)
354 gl->arr[i] = gl->arr[i + 1];
355 gl->n--;
356}
357
358
359/*

Callers 2

findlabelFunction · 0.85
findgotosFunction · 0.85

Calls 5

luaS_eqstrFunction · 0.85
getlocvarFunction · 0.85
semerrorFunction · 0.85
luaO_pushfstringFunction · 0.70
luaK_patchlistFunction · 0.70

Tested by

no test coverage detected