/* Find variable with given name 'n'. If it is an upvalue, add this upvalue into all intermediate functions.  */
static void singlevaraux(FuncState *fs, TString *n, expdesc *var, int base)
/* Find variable with given name 'n'. If it is an upvalue, add this upvalue into all intermediate functions.  */
static void singlevaraux(FuncState *fs, TString *n, expdesc *var, int base)
{
    int v = searchvar(fs, n);
    if (v >= 0) {
      init_exp(var, VLOCAL, v);
      if (!base)
        markupval(fs, v);
    }
    else {
      int idx = searchupvalue(fs, n);
      if (idx < 0) {
        singlevaraux(fs->prev, n, var, 0);
        if (var->k == VVOID)
          return;
        idx  = newupvalue(fs, n, var);
      }
      init_exp(var, VUPVAL, idx);
    }
  }
}