Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Safety fixes and refactoring #184

Closed
wants to merge 3 commits into from

Conversation

guidanoli
Copy link
Contributor

@guidanoli guidanoli commented May 14, 2021

  • Adds LuaRuntime.stack for context managing the Lua stack, which makes the code cleaner and safer
  • Calls check_lua_stack where needed (avoids Lua stack overflow)
  • Optimize py_to_lua, handling True and False separately because <bint> cast calls Py_IsTrue unnecessarily.
  • Partial rewrite of _LuaObject.__str__, _LuaTable._setitem, _LuaFunction.coroutine
  • Removed lua_settop(L, 0) from _LuaObject.__call__.
  • Renamed push_lua_arguments to py_tuple_to_lua and made it safe against py_to_lua exceptions
  • Renamed unpack_lua_results to py_tuple_from_lua and added nargs parameter instead of getting from Lua stack top

@guidanoli
Copy link
Contributor Author

See #187 for updated changes

@guidanoli guidanoli closed this Jul 16, 2021
@guidanoli guidanoli deleted the feat/safety-fixes branch July 16, 2021 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant