* Verify that the object is a DF ref with UPVAL_METATABLE. * If everything ok, extract the address. */
| 985 | * If everything ok, extract the address. |
| 986 | */ |
| 987 | uint8_t *LuaWrapper::get_object_addr(lua_State *state, int obj, int field, const char *mode) |
| 988 | { |
| 989 | if (!lua_isuserdata(state, obj) || |
| 990 | !lua_getmetatable(state, obj)) |
| 991 | field_error(state, field, "invalid object", mode); |
| 992 | |
| 993 | if (!lua_rawequal(state, -1, UPVAL_METATABLE)) |
| 994 | field_error(state, field, "invalid object metatable", mode); |
| 995 | |
| 996 | lua_pop(state, 1); |
| 997 | |
| 998 | return (uint8_t*)get_object_ref(state, obj); |
| 999 | } |
| 1000 | |
| 1001 | /** |
| 1002 | * Metamethod: represent a type node as string. |
nothing calls this directly
no test coverage detected