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

Function newupvalue

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

Source from the content-addressed store, hash-verified

227
228
229static int newupvalue (FuncState *fs, TString *name, expdesc *v) {
230 Proto *f = fs->f;
231 int oldsize = f->sizeupvalues;
232 checklimit(fs, fs->nups + 1, MAXUPVAL, "upvalues");
233 luaM_growvector(fs->ls->L, f->upvalues, fs->nups, f->sizeupvalues,
234 Upvaldesc, MAXUPVAL, "upvalues");
235 while (oldsize < f->sizeupvalues) f->upvalues[oldsize++].name = NULL;
236 f->upvalues[fs->nups].instack = (v->k == VLOCAL);
237 f->upvalues[fs->nups].idx = cast_byte(v->u.info);
238 f->upvalues[fs->nups].name = name;
239 luaC_objbarrier(fs->ls->L, f, name);
240 return fs->nups++;
241}
242
243
244static int searchvar (FuncState *fs, TString *n) {

Callers 2

singlevarauxFunction · 0.85
mainfuncFunction · 0.85

Calls 1

checklimitFunction · 0.85

Tested by

no test coverage detected