You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently (in sol2 version 3.3.0) there is no way to use sol::environment and lua_Reader together. sol::state::safe_script doesn't have an overload that can accept both, and sol::set_environment doesn't accept sol::load_result.
Why I have this problem:
I'm using Sol in an environment that I can't make any assumptions about the provided scripts. I'm planning to utilize sol::environment to prevent scripts from calling potentially dangerous functions that are provided by the Lua libraries. I can't be sure that the loaded scripts are small enough to fit in the ram, so loading all of the script to a std::string is not a viable option, and I might need to load scripts from non-conventional sources in the future, so loading the script using sol::state::safe_script_file is not a viable option either. So my only option is to use lua_Reader.
Possible solutions
Adding an overload to sol::state::(safe_)script that accepts lua_Reader and sol::environment at the same time.
Allowing sol::environment::set_on and sol::set_environment to accept sol::load_result.
The text was updated successfully, but these errors were encountered:
The problem:
Currently (in sol2 version 3.3.0) there is no way to use
sol::environment
andlua_Reader
together.sol::state::safe_script
doesn't have an overload that can accept both, andsol::set_environment
doesn't acceptsol::load_result
.Why I have this problem:
I'm using Sol in an environment that I can't make any assumptions about the provided scripts. I'm planning to utilize
sol::environment
to prevent scripts from calling potentially dangerous functions that are provided by the Lua libraries. I can't be sure that the loaded scripts are small enough to fit in the ram, so loading all of the script to astd::string
is not a viable option, and I might need to load scripts from non-conventional sources in the future, so loading the script usingsol::state::safe_script_file
is not a viable option either. So my only option is to uselua_Reader
.Possible solutions
sol::state::(safe_)script
that acceptslua_Reader
andsol::environment
at the same time.sol::environment::set_on
andsol::set_environment
to acceptsol::load_result
.The text was updated successfully, but these errors were encountered: