| 69 | } |
| 70 | |
| 71 | static void *luaL_testudata(lua_State *L, int idx, const char *type) { |
| 72 | void *p = lua_touserdata(L, idx); |
| 73 | if (p != NULL && lua_getmetatable(L, idx)) { |
| 74 | lua_getfield(L, LUA_REGISTRYINDEX, type); |
| 75 | if (!lua_rawequal(L, -2, -1)) |
| 76 | p = NULL; |
| 77 | lua_pop(L, 2); |
| 78 | return p; |
| 79 | } |
| 80 | return NULL; |
| 81 | } |
| 82 | |
| 83 | #endif |
| 84 |
no test coverage detected