Repository navigation
Conversation
Add named lookup and positional conversion errors; by-value classes, const T* borrows, unique_ptr move-in and shared_ptr sharing; reg_base safe upcasts with inherited methods/properties; class method overloads, __call constructors, field properties, and tuple multi-return; and lua_Integer container indices. Prepare CMake/docs for a possible v1.1.0 without tagging a release.
thread_local state around the C++ exception to luaL_error boundary caused LuaJIT (shared library) to report "unknown C++ exception" from call_lua_* instead of the native what(). Keep prefixes state-local and avoid TLS.
On MSVC, luaL_error longjmps out of a boundary try block when a field getter/setter or overload is invoked via lua_call, which can abort regressions with 0xC0000409. Catch Lua errors with lua_pcall and rethrow as C++ so the boundary unwinds first. Also log regression steps for diagnosis.
pcall_checked now treats a non-zero lua_pcall result as failure, matching other protected-call sites. Retry apt-get in Linux CI after a transient mirror 503 on liblua5.2.
Ubuntu universe mirrors were returning 503 for libluajit-5.1-dev even after retries. Keep testing the shared library so the foreign-unwinder path stays covered.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Six follow-up improvements on
master(8789f16):no function 'foo',no table 'bar' in path '...'); conversion failures include a position prefix (argument 2:,return 1:,element 3:).const T*is a non-owning borrow;std::unique_ptr<T>can be moved into Lua but not recovered;std::shared_ptr<T>shares the control block and can be recovered only from exact-type shared-backed userdata.reg_base<Derived, Base>lets a derived pointer be used where a base is expected. Base methods/properties are visible on derived objects. No implicit downcast; unrelated same-address types are still rejected.reg_class_overload(arity-only, includingself);__callconstructors on the registered type name (A(1)); field properties via__index/__newindexin addition toget_/set_; C++std::tuple/std::pairmulti-return.lua_Integer(lua_rawgeti/lua_rawsetion Lua 5.3+; apushinteger+rawget/rawsetfallback on 5.1/5.2 when the index does not fitint).lua_createtablehints remain clamped toint.project(bLua VERSION 1.1.0)(find_package(bLua 1.0)still matches underSameMajorVersion). CHANGELOG no longer describes Windows CI as vcpkg Lua; it matches the pinned official Lua 5.4.7 / MSVC sources. README / README_CN list Lua 5.1, 5.2, and LuaJIT as Supported (CI). Changelog is prepared for a possiblev1.1.0; this PR does not tag or create a GitHub Release.Header-only C++17 design is unchanged.
reg_constructor’snameis now optional; additional named constructors with the same arity reuse the existing__callslot.Local tests
All 5/5 (
blua_test, regressions, intentional failure exits, relocatedfind_packageconsumer):Lua 5.1/5.2, LuaJIT, Windows, and macOS were not run locally; this PR is meant to verify them on CI.
Notes
Please do not merge until CI is green and the maintainer asks for it. Do not tag
v1.1.0in this PR.