| 8 | static std::weak_ptr<int> ptr; |
| 9 | |
| 10 | static int func(lua_State *L) { |
| 11 | auto mem = std::make_shared<int>(42); |
| 12 | ptr = mem; |
| 13 | asm volatile("": : :"memory"); |
| 14 | luaL_error(L, "error"); |
| 15 | return 0; |
| 16 | } |
| 17 | |
| 18 | TEST(LuaTest, CppStackUnwrap) { |
| 19 | // Lua needs to be configured to use C++ exceptions instead of longjmp for this to succeed |