** 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. */
| 266 | ** in that case all prototypes must be consistent for the GC. |
| 267 | */ |
| 268 | static 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 | |
| 283 | static void loadDebug (LoadState *S, Proto *f) { |
no test coverage detected