** Search the upvalues of the function 'fs' for one ** with the given 'name'. */
| 340 | ** with the given 'name'. |
| 341 | */ |
| 342 | static int searchupvalue (FuncState *fs, TString *name) { |
| 343 | int i; |
| 344 | Upvaldesc *up = fs->f->upvalues; |
| 345 | for (i = 0; i < fs->nups; i++) { |
| 346 | if (eqstr(up[i].name, name)) return i; |
| 347 | } |
| 348 | return -1; /* not found */ |
| 349 | } |
| 350 | |
| 351 | |
| 352 | static Upvaldesc *allocupvalue (FuncState *fs) { |