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

Function loadUpvalues

third-party/lua-5.5.0/src/lundump.c:268–280  ·  view source on GitHub ↗

** Load the upvalues for a function. The names must be filled first, ** because the filling of the other fields can raise read errors and ** the creation of the error message can call an emergency collection; ** in that case all prototypes must be consistent for the GC. */

Source from the content-addressed store, hash-verified

266** in that case all prototypes must be consistent for the GC.
267*/
268static void loadUpvalues (LoadState *S, Proto *f) {
269 int i;
270 int n = loadInt(S);
271 f->upvalues = luaM_newvectorchecked(S->L, n, Upvaldesc);
272 f->sizeupvalues = n;
273 for (i = 0; i < n; i++) /* make array valid for GC */
274 f->upvalues[i].name = NULL;
275 for (i = 0; i < n; i++) { /* following calls can raise errors */
276 f->upvalues[i].instack = loadByte(S);
277 f->upvalues[i].idx = loadByte(S);
278 f->upvalues[i].kind = loadByte(S);
279 }
280}
281
282
283static void loadDebug (LoadState *S, Proto *f) {

Callers 1

loadFunctionFunction · 0.70

Calls 2

loadIntFunction · 0.70
loadByteFunction · 0.70

Tested by

no test coverage detected