stack_aligned_function cannot be influenced by SOL_SAFE_FUNCTION: it has different semantics and thus needs to remain unsafe.

This commit is contained in:
ThePhD 2017-12-08 01:22:22 -05:00
parent 36b8d50e27
commit 5f688537e0
3 changed files with 5 additions and 6 deletions

View File

@ -30,6 +30,7 @@ Safety Config
``SOL_SAFE_FUNCTION`` triggers the following change: ``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`` * 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 * 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* * **Not** turned on by default under any detectible compiler settings: *this MUST be turned on manually*

View File

@ -20,8 +20,8 @@
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// This file was generated with a script. // This file was generated with a script.
// Generated 2017-12-08 03:30:27.683226 UTC // Generated 2017-12-08 06:22:13.819358 UTC
// This header was generated with sol v2.19.0 (revision a2e0217) // This header was generated with sol v2.19.0 (revision 36b8d50)
// https://github.com/ThePhD/sol2 // https://github.com/ThePhD/sol2
#ifndef SOL_SINGLE_INCLUDE_HPP #ifndef SOL_SINGLE_INCLUDE_HPP
@ -259,13 +259,12 @@ namespace sol {
using function = protected_function; using function = protected_function;
using main_function = main_protected_function; using main_function = main_protected_function;
using stack_function = stack_protected_function; using stack_function = stack_protected_function;
using stack_aligned_function = stack_aligned_safe_function;
#else #else
using function = unsafe_function; using function = unsafe_function;
using main_function = main_unsafe_function; using main_function = main_unsafe_function;
using stack_function = stack_unsafe_function; using stack_function = stack_unsafe_function;
using stack_aligned_function = stack_aligned_unsafe_function;
#endif #endif
using stack_aligned_function = stack_aligned_unsafe_function;
using stack_aligned_stack_handler_function = basic_protected_function<stack_reference, true, stack_reference>; using stack_aligned_stack_handler_function = basic_protected_function<stack_reference, true, stack_reference>;
struct unsafe_function_result; struct unsafe_function_result;

View File

@ -83,13 +83,12 @@ namespace sol {
using function = protected_function; using function = protected_function;
using main_function = main_protected_function; using main_function = main_protected_function;
using stack_function = stack_protected_function; using stack_function = stack_protected_function;
using stack_aligned_function = stack_aligned_safe_function;
#else #else
using function = unsafe_function; using function = unsafe_function;
using main_function = main_unsafe_function; using main_function = main_unsafe_function;
using stack_function = stack_unsafe_function; using stack_function = stack_unsafe_function;
using stack_aligned_function = stack_aligned_unsafe_function;
#endif #endif
using stack_aligned_function = stack_aligned_unsafe_function;
using stack_aligned_stack_handler_function = basic_protected_function<stack_reference, true, stack_reference>; using stack_aligned_stack_handler_function = basic_protected_function<stack_reference, true, stack_reference>;
struct unsafe_function_result; struct unsafe_function_result;