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