/* Find and reuse, or create if it does not exist, an upvalue at the given level.  */
UpVal* luaF_findupval(lua_State *L, StkId level)
/* Find and reuse, or create if it does not exist, an upvalue at the given level.  */
UpVal* luaF_findupval(lua_State *L, StkId level)
{
    lua_assert(!isdead(G(L), p));
    if (uplevel(p) == level)
      return p;
    pp = &p->u.open.next;
  }
  return newupval(L, 0, level, pp);
}