/* Convert a valid actual index (not a pseudo-index) to its address.  */
l_sinline StkId index2stack(lua_State *L, int idx)
/* Convert a valid actual index (not a pseudo-index) to its address.  */
l_sinline StkId index2stack(lua_State *L, int idx)
{
    StkId o = ci->func + idx;
    api_check(L, o < L->top, "invalid index");
    return o;
  }
  else {
    api_check(L, idx != 0 && -idx <= L->top - (ci->func + 1), "invalid index");
    api_check(L, !ispseudo(idx), "invalid index");
    return L->top + idx;
  }
}