** Look for an active local variable with the name 'n' in the ** function 'fs'. If found, initialize 'var' with it and return ** its expression kind; otherwise return -1. */
| 388 | ** its expression kind; otherwise return -1. |
| 389 | */ |
| 390 | static int searchvar (FuncState *fs, TString *n, expdesc *var) { |
| 391 | int i; |
| 392 | for (i = cast_int(fs->nactvar) - 1; i >= 0; i--) { |
| 393 | Vardesc *vd = getlocalvardesc(fs, i); |
| 394 | if (eqstr(n, vd->vd.name)) { /* found? */ |
| 395 | if (vd->vd.kind == RDKCTC) /* compile-time constant? */ |
| 396 | init_exp(var, VCONST, fs->firstlocal + i); |
| 397 | else /* real variable */ |
| 398 | init_var(fs, var, i); |
| 399 | return var->k; |
| 400 | } |
| 401 | } |
| 402 | return -1; /* not found */ |
| 403 | } |
| 404 | |
| 405 | |
| 406 | /* |
no test coverage detected