| 430 | |
| 431 | |
| 432 | LUA_API const void *lua_topointer(lua_State *L, int idx) { |
| 433 | StkId o = index2addr(L, idx); |
| 434 | switch (ttype(o)) { |
| 435 | case LUA_TTABLE: return hvalue(o); |
| 436 | case LUA_TLCL: return clLvalue(o); |
| 437 | case LUA_TCCL: return clCvalue(o); |
| 438 | case LUA_TLCF: return lua_cast(void *, lua_cast(size_t, fvalue(o))); |
| 439 | case LUA_TTHREAD: return thvalue(o); |
| 440 | case LUA_TUSERDATA: return getudatamem(uvalue(o)); |
| 441 | case LUA_TLIGHTUSERDATA: return pvalue(o); |
| 442 | default: return nullptr; |
| 443 | } |
| 444 | } |
| 445 | |
| 446 | |
| 447 |
no test coverage detected