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

Porting to lua 5.1 #203

Open
moonshadow565 opened this issue Oct 26, 2018 · 0 comments
Open

Porting to lua 5.1 #203

moonshadow565 opened this issue Oct 26, 2018 · 0 comments

Comments

@moonshadow565
Copy link

moonshadow565 commented Oct 26, 2018

This isn't a proposal or a request for feature; it's more of me asking for help on some issues I have been facing with this endeavur.
So far it has been pretty trivial to get this to run on 5.1. It has been simple simple as:

All of tests pass except one problematic case where it crashes.

  1. Using clousures that capture refrences:
    https://github.com/moonshadow565/hlua/blob/dc1eb4ea9d9dd7f7228e2e674aa1b3033b616af8/hlua/src/functions_write.rs#L541

  2. Passing clousures as refrences:
    https://github.com/moonshadow565/hlua/blob/dc1eb4ea9d9dd7f7228e2e674aa1b3033b616af8/hlua/tests/userdata.rs#L216

Somehow those references get dropped and turn into 0 reference leading into segfault.
Any idea of why this might be happening?

As an afterthought, I don't really think there should be much of trouble being compatible with both Lua 5.1 and 5.2 and even 5.3.
An example would be https://github.com/ThePhD/sol2.
Which is a powerful, light and safe C++14 wrapper around Lua compatible with 5.1, 5.2 and 5.3 lua versions.

If this doesn't work I'm afraid I'll only be left with an option of writing scripting API in C++ and
exposing it as C API to rust.

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

No branches or pull requests

1 participant