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

Function loadUpvalues

lib/lua/src/lundump.c:212–224  ·  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

210** in that case all prototypes must be consistent for the GC.
211*/
212static void loadUpvalues (LoadState *S, Proto *f) {
213 int i, n;
214 n = loadInt(S);
215 f->upvalues = luaM_newvectorchecked(S->L, n, Upvaldesc);
216 f->sizeupvalues = n;
217 for (i = 0; i < n; i++) /* make array valid for GC */
218 f->upvalues[i].name = NULL;
219 for (i = 0; i < n; i++) { /* following calls can raise errors */
220 f->upvalues[i].instack = loadByte(S);
221 f->upvalues[i].idx = loadByte(S);
222 f->upvalues[i].kind = loadByte(S);
223 }
224}
225
226
227static void loadDebug (LoadState *S, Proto *f) {

Callers 1

loadFunctionFunction · 0.85

Calls 2

loadIntFunction · 0.85
loadByteFunction · 0.85

Tested by

no test coverage detected