diff --git a/single/sol/sol.hpp b/single/sol/sol.hpp index 7a765cc8..153452a2 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-04-09 16:04:17.392392 UTC -// This header was generated with sol v2.17.0 (revision 8145622) +// Generated 2017-04-09 17:03:27.912893 UTC +// This header was generated with sol 2.17.0 (revision 2df532f) // https://github.com/ThePhD/sol2 #ifndef SOL_SINGLE_INCLUDE_HPP @@ -13093,8 +13093,8 @@ namespace sol { if (x != load_status::ok) { return protected_function_result(L, -1, 0, 1, static_cast(x)); } - stack::push_popper_at pp(L, lua_absindex(L, -1), 1); protected_function pf(L, -1); + pf.pop(); set_environment(env, pf); return pf(); } @@ -13105,8 +13105,8 @@ namespace sol { if (x != load_status::ok) { return protected_function_result(L, -1, 0, 1, static_cast(x)); } - stack::push_popper_at pp(L, lua_absindex(L, -1), 1); - stack_protected_function pf(L, -1); + protected_function pf(L, -1); + pf.pop(); set_environment(env, pf); return pf(); } @@ -13116,8 +13116,8 @@ namespace sol { if (x != load_status::ok) { return protected_function_result(L, -1, 0, 1, static_cast(x)); } - stack::push_popper_at pp(L, lua_absindex(L, -1), 1); - stack_protected_function pf(L, -1); + protected_function pf(L, -1); + pf.pop(); return pf(); } @@ -13126,8 +13126,8 @@ namespace sol { if (x != load_status::ok) { return protected_function_result(L, -1, 0, 1, static_cast(x)); } - stack::push_popper_at pp(L, lua_absindex(L, -1), 1); protected_function pf(L, -1); + pf.pop(); return pf(); } diff --git a/sol/state_view.hpp b/sol/state_view.hpp index fb8d19a2..4592b2d4 100644 --- a/sol/state_view.hpp +++ b/sol/state_view.hpp @@ -263,8 +263,8 @@ namespace sol { if (x != load_status::ok) { return protected_function_result(L, -1, 0, 1, static_cast(x)); } - stack::push_popper_at pp(L, lua_absindex(L, -1), 1); protected_function pf(L, -1); + pf.pop(); set_environment(env, pf); return pf(); } @@ -275,8 +275,8 @@ namespace sol { if (x != load_status::ok) { return protected_function_result(L, -1, 0, 1, static_cast(x)); } - stack::push_popper_at pp(L, lua_absindex(L, -1), 1); - stack_protected_function pf(L, -1); + protected_function pf(L, -1); + pf.pop(); set_environment(env, pf); return pf(); } @@ -286,8 +286,8 @@ namespace sol { if (x != load_status::ok) { return protected_function_result(L, -1, 0, 1, static_cast(x)); } - stack::push_popper_at pp(L, lua_absindex(L, -1), 1); - stack_protected_function pf(L, -1); + protected_function pf(L, -1); + pf.pop(); return pf(); } @@ -296,8 +296,8 @@ namespace sol { if (x != load_status::ok) { return protected_function_result(L, -1, 0, 1, static_cast(x)); } - stack::push_popper_at pp(L, lua_absindex(L, -1), 1); protected_function pf(L, -1); + pf.pop(); return pf(); } diff --git a/test_state.cpp b/test_state.cpp index 3cefdf61..026c4e82 100644 --- a/test_state.cpp +++ b/test_state.cpp @@ -68,6 +68,7 @@ TEST_CASE("state/require_script", "opening strings as 'requires' clauses") { std::string code = "return { modfunc = function () return 221 end }"; sol::state lua; + sol::stack_guard sg(lua); sol::table thingy1 = lua.require_script("thingy", code); sol::table thingy2 = lua.require_script("thingy", code); @@ -88,6 +89,7 @@ TEST_CASE("state/require", "opening using a file") { }; sol::state lua; + sol::stack_guard sg(lua); sol::table thingy1 = lua.require("thingy", open::open_func); sol::table thingy2 = lua.require("thingy", open::open_func); @@ -258,6 +260,7 @@ return example; }; sol::state lua; + sol::stack_guard sg(lua); lua.open_libraries(); lua.set_function("foo", foo); @@ -282,6 +285,7 @@ TEST_CASE("state/copy-move", "ensure state can be properly copied and moved") { TEST_CASE("state/requires-reload", "ensure that reloading semantics do not cause a crash") { sol::state lua; + sol::stack_guard sg(lua); lua.open_libraries(); lua.script("require 'io'\nreturn 'test1'"); lua.require_script("test2", "require 'io'\nreturn 'test2'"); @@ -298,6 +302,7 @@ TEST_CASE("state/script-do-load", "test success and failure cases for loading an SECTION("script") { sol::state lua; + sol::stack_guard sg(lua); int ar = lua.script(good); int a = lua["a"]; REQUIRE(a == 21); @@ -305,6 +310,7 @@ TEST_CASE("state/script-do-load", "test success and failure cases for loading an } SECTION("script-handler") { sol::state lua; + sol::stack_guard sg(lua); auto errbs = lua.script(bad_syntax, sol::simple_on_error); REQUIRE(!errbs.valid()); @@ -320,6 +326,7 @@ TEST_CASE("state/script-do-load", "test success and failure cases for loading an } SECTION("do_string") { sol::state lua; + sol::stack_guard sg(lua); auto errbs = lua.do_string(bad_syntax); REQUIRE(!errbs.valid()); @@ -335,6 +342,7 @@ TEST_CASE("state/script-do-load", "test success and failure cases for loading an } SECTION("load_string") { sol::state lua; + sol::stack_guard sg(lua); auto errbsload = lua.load(bad_syntax); REQUIRE(!errbsload.valid()); @@ -364,6 +372,7 @@ TEST_CASE("state/script-do-load", "test success and failure cases for loading an } SECTION("script_file") { sol::state lua; + sol::stack_guard sg(lua); int ar = lua.script_file(file_good); int a = lua["a"]; REQUIRE(a == 21); @@ -371,6 +380,7 @@ TEST_CASE("state/script-do-load", "test success and failure cases for loading an } SECTION("script_file-handler") { sol::state lua; + sol::stack_guard sg(lua); auto errbs = lua.script_file(file_bad_syntax, sol::simple_on_error); REQUIRE(!errbs.valid()); @@ -386,6 +396,7 @@ TEST_CASE("state/script-do-load", "test success and failure cases for loading an } SECTION("do_file") { sol::state lua; + sol::stack_guard sg(lua); auto errbs = lua.do_file(file_bad_syntax); REQUIRE(!errbs.valid()); @@ -401,6 +412,7 @@ TEST_CASE("state/script-do-load", "test success and failure cases for loading an } SECTION("load_file") { sol::state lua; + sol::stack_guard sg(lua); auto errbsload = lua.load_file(file_bad_syntax); REQUIRE(!errbsload.valid());