/* Checks whether value 'o' came from an upvalue. (That can only happen with instructions OP_GETTABUP/OP_SETTABUP, which operate directly on upvalues.)  */
static const char* getupvalname(CallInfo *ci, const TValue *o, const char **name)
/* Checks whether value 'o' came from an upvalue. (That can only happen with instructions OP_GETTABUP/OP_SETTABUP, which operate directly on upvalues.)  */
static const char* getupvalname(CallInfo *ci, const TValue *o, const char **name)
{
  LClosure *c = ci_func(ci);
  int i;
  for (i = 0; i < c->nupvalues; i++) {
    if (c->upvals[i]->v == o) {
      *name = upvalname(c->p, i);
      return "upvalue";
    }
  }
  return NULL;
}