get should throw an error that can be caught and handled.
Debugging Context
When debugging this issue, we've identified that the problem is caused by the clean helper created here. It calls lua_pop in it's destructor which tries to call __close on some object, but __close is nil, raising a subsequent panic which results in a throw in a C++ destructor of clean which will call terminate.
Accessing table field with the wrong user type causes a segmentation fault.
Context
Language:
C++
Sol Version:3.3.0
Defines:SOL_ALL_SAFETIES_ON
,SOL_USE_CXX_LUA
Reproduction
Godbolt, which doesn't can't use
SOL_USE_CXX_LUA
.Expectation
get
should throw an error that can be caught and handled.Debugging Context
When debugging this issue, we've identified that the problem is caused by the
clean
helper created here. It callslua_pop
in it's destructor which tries to call__close
on some object, but__close
is nil, raising a subsequent panic which results in a throw in a C++ destructor ofclean
which will call terminate.