mirror of
https://github.com/ThePhD/sol2.git
synced 2024-03-22 13:10:44 +08:00
13 lines
363 B
C++
13 lines
363 B
C++
|
#include <sol/sol.hpp>
|
||
|
|
||
|
int regression_1072() {
|
||
|
auto st = sol::state {};
|
||
|
// If you remove the capture, the problem goes away.
|
||
|
st["foo"] = [&] { throw std::runtime_error(""); };
|
||
|
sol::protected_function_result result = st.safe_script("foo()", sol::script_pass_on_error);
|
||
|
if (!result.valid()) {
|
||
|
sol::error err = result;
|
||
|
return 0;
|
||
|
}
|
||
|
return 1;
|
||
|
}
|