** Start the scope for the last 'nvars' created variables. */
| 326 | ** Start the scope for the last 'nvars' created variables. |
| 327 | */ |
| 328 | static void adjustlocalvars (LexState *ls, int nvars) { |
| 329 | FuncState *fs = ls->fs; |
| 330 | int reglevel = luaY_nvarstack(fs); |
| 331 | int i; |
| 332 | for (i = 0; i < nvars; i++) { |
| 333 | int vidx = fs->nactvar++; |
| 334 | Vardesc *var = getlocalvardesc(fs, vidx); |
| 335 | var->vd.ridx = cast_byte(reglevel++); |
| 336 | var->vd.pidx = registerlocalvar(ls, fs, var->vd.name); |
| 337 | luaY_checklimit(fs, reglevel, MAXVARS, "local variables"); |
| 338 | } |
| 339 | } |
| 340 | |
| 341 | |
| 342 | /* |
no test coverage detected