From 8f007074ff7d6344b3269bd33022d6ecca4d5933 Mon Sep 17 00:00:00 2001 From: ThePhD Date: Tue, 3 Oct 2017 10:46:26 -0400 Subject: [PATCH] I REMEMBER NOW --- single/sol/sol.hpp | 11 ++++++----- sol/simple_usertype_metatable.hpp | 2 +- sol/stack_push.hpp | 2 +- sol/usertype_metatable.hpp | 3 ++- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/single/sol/sol.hpp b/single/sol/sol.hpp index f76f2e4c..7e802856 100644 --- a/single/sol/sol.hpp +++ b/single/sol/sol.hpp @@ -20,8 +20,8 @@ // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // This file was generated with a script. -// Generated 2017-10-03 12:26:06.843171 UTC -// This header was generated with sol v2.18.4 (revision 3660aec) +// Generated 2017-10-03 14:46:14.157422 UTC +// This header was generated with sol v2.18.4 (revision c5505c2) // https://github.com/ThePhD/sol2 #ifndef SOL_SINGLE_INCLUDE_HPP @@ -9380,7 +9380,7 @@ namespace stack { template <> struct pusher { static int push(lua_State* L, userdata_value data) { - void** ud = static_cast(lua_newuserdata(L, sizeof(void*))); + void** ud = detail::usertype_allocate_pointer(L); *ud = data.value; return 1; } @@ -16803,7 +16803,8 @@ namespace sol { umt.pop(); stack::get_field(L, gcmetakey); - return stack::pop>(L); + umt_t& target_umt = stack::pop>(L); + return target_umt; } static int push(lua_State* L, umt_t&& umx) { @@ -17312,7 +17313,7 @@ namespace sol { stackvarmap.pop(); stack::get_field(L, gcmetakey); - usertype_detail::simple_map& varmap = stack::pop>(L); + usertype_detail::simple_map& varmap = stack::pop>(L); return varmap; } diff --git a/sol/simple_usertype_metatable.hpp b/sol/simple_usertype_metatable.hpp index 3ed1cabc..ca6d8a7d 100644 --- a/sol/simple_usertype_metatable.hpp +++ b/sol/simple_usertype_metatable.hpp @@ -404,7 +404,7 @@ namespace sol { stackvarmap.pop(); stack::get_field(L, gcmetakey); - usertype_detail::simple_map& varmap = stack::pop>(L); + usertype_detail::simple_map& varmap = stack::pop>(L); return varmap; } diff --git a/sol/stack_push.hpp b/sol/stack_push.hpp index f11e5f61..95f9f3e7 100644 --- a/sol/stack_push.hpp +++ b/sol/stack_push.hpp @@ -512,7 +512,7 @@ namespace stack { template <> struct pusher { static int push(lua_State* L, userdata_value data) { - void** ud = static_cast(lua_newuserdata(L, sizeof(void*))); + void** ud = detail::usertype_allocate_pointer(L); *ud = data.value; return 1; } diff --git a/sol/usertype_metatable.hpp b/sol/usertype_metatable.hpp index e1b44569..edb7cfe8 100644 --- a/sol/usertype_metatable.hpp +++ b/sol/usertype_metatable.hpp @@ -649,7 +649,8 @@ namespace sol { umt.pop(); stack::get_field(L, gcmetakey); - return stack::pop>(L); + umt_t& target_umt = stack::pop>(L); + return target_umt; } static int push(lua_State* L, umt_t&& umx) {