From 5f688537e061594a00aac656b51969ae08f47a16 Mon Sep 17 00:00:00 2001 From: ThePhD Date: Fri, 8 Dec 2017 01:22:22 -0500 Subject: [PATCH] stack_aligned_function cannot be influenced by SOL_SAFE_FUNCTION: it has different semantics and thus needs to remain unsafe. --- docs/source/safety.rst | 1 + single/sol/sol.hpp | 7 +++---- sol/forward.hpp | 3 +-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/docs/source/safety.rst b/docs/source/safety.rst index d7810797..bf66fd52 100644 --- a/docs/source/safety.rst +++ b/docs/source/safety.rst @@ -30,6 +30,7 @@ Safety Config ``SOL_SAFE_FUNCTION`` triggers the following change: * All uses of ``sol::function`` and ``sol::stack_function`` will default to ``sol::protected_function`` and ``sol::stack_protected_function``, respectively, rather than ``sol::unsafe_function`` and ``sol::stack_unsafe_function`` + - Note this does not apply to ``sol::stack_aligned_function``: this variant must always be unprotected due to stack positioning requirements, especially in use with ``sol::stack_count`` * Will make any ``sol::state_view::script`` calls default to their safe variants if there is no supplied environment or error handler function * **Not** turned on by default under any detectible compiler settings: *this MUST be turned on manually* diff --git a/single/sol/sol.hpp b/single/sol/sol.hpp index 5c5d7ded..6c666778 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-12-08 03:30:27.683226 UTC -// This header was generated with sol v2.19.0 (revision a2e0217) +// Generated 2017-12-08 06:22:13.819358 UTC +// This header was generated with sol v2.19.0 (revision 36b8d50) // https://github.com/ThePhD/sol2 #ifndef SOL_SINGLE_INCLUDE_HPP @@ -259,13 +259,12 @@ namespace sol { using function = protected_function; using main_function = main_protected_function; using stack_function = stack_protected_function; - using stack_aligned_function = stack_aligned_safe_function; #else using function = unsafe_function; using main_function = main_unsafe_function; using stack_function = stack_unsafe_function; - using stack_aligned_function = stack_aligned_unsafe_function; #endif + using stack_aligned_function = stack_aligned_unsafe_function; using stack_aligned_stack_handler_function = basic_protected_function; struct unsafe_function_result; diff --git a/sol/forward.hpp b/sol/forward.hpp index 32a310ea..6c00e6a0 100644 --- a/sol/forward.hpp +++ b/sol/forward.hpp @@ -83,13 +83,12 @@ namespace sol { using function = protected_function; using main_function = main_protected_function; using stack_function = stack_protected_function; - using stack_aligned_function = stack_aligned_safe_function; #else using function = unsafe_function; using main_function = main_unsafe_function; using stack_function = stack_unsafe_function; - using stack_aligned_function = stack_aligned_unsafe_function; #endif + using stack_aligned_function = stack_aligned_unsafe_function; using stack_aligned_stack_handler_function = basic_protected_function; struct unsafe_function_result;