diff --git a/luaaa.hpp b/luaaa.hpp index bde29d4..82eb58d 100644 --- a/luaaa.hpp +++ b/luaaa.hpp @@ -454,7 +454,8 @@ namespace LUAAA_NS template void LuaInvokeVoidImpl(lua_State* state, void* calleePtr, size_t skip, indices) { - (*(FTYPE*)(calleePtr))(LuaStack::get(state, Ns + 2 + skip)...); + LUAAA_DUMP(state, "3"); + (*(FTYPE*)(calleePtr))(LuaStack::get(state, Ns + 1 + skip)...); } template @@ -466,7 +467,8 @@ namespace LUAAA_NS template TRET LuaInvokeImpl(lua_State* state, void* calleePtr, size_t skip, indices) { - return (*(FTYPE*)(calleePtr))(LuaStack::get(state, Ns + 2 + skip)...); + LUAAA_DUMP(state, "4"); + return (*(FTYPE*)(calleePtr))(LuaStack::get(state, Ns + 1 + skip)...); } template @@ -570,6 +572,7 @@ namespace LUAAA_NS template TRET LuaInvokeInstanceMemberImpl(lua_State* state, void* calleePtr, indices) { + LUAAA_DUMP(state, "1"); return (LuaStack::get(state, 1).**(FTYPE*)(calleePtr))(LuaStack::get(state, Ns + 2)...); } @@ -582,6 +585,7 @@ namespace LUAAA_NS template void LuaInvokeInstanceMemberVoidImpl(lua_State* state, void* calleePtr, indices) { + LUAAA_DUMP(state, "2"); (LuaStack::get(state, 1).**(FTYPE*)(calleePtr))(LuaStack::get(state, Ns + 2)...); } @@ -786,7 +790,7 @@ namespace LUAAA_NS TCLASS ** objPtr = (TCLASS **)lua_newuserdata(state, sizeof(TCLASS*) + sizeof(TCLASS)); if (objPtr) { - TCLASS * obj = PlacementConstructorCaller(state, (void*)(objPtr + 1)); + TCLASS * obj = PlacementConstructorCaller::Invoke(state, (void*)(objPtr + 1)); *objPtr = obj; luaL_Reg destructor[] = { { "__gc", HelperClass::f_gc },{ nullptr, nullptr } };