diff --git a/library/LuaApi.cpp b/library/LuaApi.cpp index 74019c4e1..387ac4d97 100644 --- a/library/LuaApi.cpp +++ b/library/LuaApi.cpp @@ -2384,7 +2384,7 @@ static int internal_getVTable(lua_State *L) const char *name = luaL_checkstring(L, 1); uintptr_t addr = (uintptr_t)Core::getInstance().vinfo->getVTable(name); if (addr) - lua_pushnumber(L, addr); + lua_pushinteger(L, addr); else lua_pushnil(L); return 1; diff --git a/library/LuaWrapper.cpp b/library/LuaWrapper.cpp index 0c5848408..813dec6b7 100644 --- a/library/LuaWrapper.cpp +++ b/library/LuaWrapper.cpp @@ -451,6 +451,7 @@ static const char *const primitive_types[] = { "ptr-string", "int8_t", "uint8_t", "int16_t", "uint16_t", "int32_t", "uint32_t", "int64_t", "uint64_t", + "intptr_t", "uintptr_t", "long", "bool", "float", "double", "pointer", "ptr-vector", @@ -465,6 +466,8 @@ static type_identity *const primitive_identities[] = { df::identity_traits::get(), df::identity_traits::get(), df::identity_traits::get(), df::identity_traits::get(), df::identity_traits::get(), df::identity_traits::get(), + df::identity_traits::get(), df::identity_traits::get(), + df::identity_traits::get(), df::identity_traits::get(), df::identity_traits::get(), df::identity_traits::get(), df::identity_traits::get(), @@ -572,7 +575,7 @@ static int meta_sizeof(lua_State *state) if (lua_isnil(state, 1) || lua_islightuserdata(state, 1)) { lua_pushnil(state); - lua_pushnumber(state, (size_t)lua_touserdata(state, 1)); + lua_pushinteger(state, (size_t)lua_touserdata(state, 1)); return 2; } @@ -595,7 +598,7 @@ static int meta_sizeof(lua_State *state) // Add the address if (lua_isuserdata(state, 1)) { - lua_pushnumber(state, (size_t)get_object_ref(state, 1)); + lua_pushinteger(state, (size_t)get_object_ref(state, 1)); return 2; } else