diff options
Diffstat (limited to 'src/lj_api.c')
-rw-r--r-- | src/lj_api.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/src/lj_api.c b/src/lj_api.c index 451e4444..0b7855d7 100644 --- a/src/lj_api.c +++ b/src/lj_api.c | |||
@@ -546,17 +546,7 @@ LUA_API lua_State *lua_tothread(lua_State *L, int idx) | |||
546 | 546 | ||
547 | LUA_API const void *lua_topointer(lua_State *L, int idx) | 547 | LUA_API const void *lua_topointer(lua_State *L, int idx) |
548 | { | 548 | { |
549 | cTValue *o = index2adr(L, idx); | 549 | return lj_obj_ptr(index2adr(L, idx)); |
550 | if (tvisudata(o)) | ||
551 | return uddata(udataV(o)); | ||
552 | else if (tvislightud(o)) | ||
553 | return lightudV(o); | ||
554 | else if (tviscdata(o)) | ||
555 | return cdataptr(cdataV(o)); | ||
556 | else if (tvisgcv(o)) | ||
557 | return gcV(o); | ||
558 | else | ||
559 | return NULL; | ||
560 | } | 550 | } |
561 | 551 | ||
562 | /* -- Stack setters (object creation) ------------------------------------- */ | 552 | /* -- Stack setters (object creation) ------------------------------------- */ |