MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / newupvalue

Function newupvalue

third-party/lua-5.2.4/src/lparser.c:231–243  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 2

singlevarauxFunction · 0.70
mainfuncFunction · 0.70

Calls 1

checklimitFunction · 0.70

Tested by

no test coverage detected