** Convert 'nvar' (number of active variables at some point) to ** number of variables in the stack at that point. */
| 225 | ** number of variables in the stack at that point. |
| 226 | */ |
| 227 | static int stacklevel (FuncState *fs, int nvar) { |
| 228 | while (nvar > 0) { |
| 229 | Vardesc *vd = getlocalvardesc(fs, nvar - 1); |
| 230 | if (vd->vd.kind != RDKCTC) /* is in the stack? */ |
| 231 | return vd->vd.sidx + 1; |
| 232 | else |
| 233 | nvar--; /* try previous variable */ |
| 234 | } |
| 235 | return 0; /* no variables */ |
| 236 | } |
| 237 | |
| 238 | |
| 239 | /* |
no test coverage detected