-
-
Notifications
You must be signed in to change notification settings - Fork 490
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
Casting sol::protected_function_result to sol::error fails #705
Comments
Just gonna throw this out here: not a clue. It says there's a table on top of the stack. Not sure how a table ended up sitting on top of the stack... We are calling |
When we push stuff to the stack Or that is how it looks to me. |
Oooh, I wasn't even considering the destructors.... thanks! I'll try to debug those specifically. |
I have decided that this is a sufficiently weird case that I can't actually fix it. The primary problem is that the only true fix I have basically means I need to mess with performance and add tons of checks for various ill-formed states of the program. It also means I have to commit to making sure that every time you blow up the (actual, real, C) call stack with a call to I would much rather that you are careful with your accesses and use the proxy methods on the |
I understand that
int x = t["x"];
raises an error (at least when SOL_CHECK_ARGUMENTS is defined).However, for some reason the casting of sol::protected_function_result to sol::error fails in the marked spot with following:
[sol2] An error occurred and panic has been invoked: stack index 1, expected string, received table
Any idea why this happens?
Isnt this the correct way to check the result of the call and get the error message?
Details: VisualStudio 2017 15.8.1, C++14,
#define SOL_CHECK_ARGUMENTS true
Sol2: https://github.com/ThePhD/sol2/blob/f438284a47294dc0fc92fd1a8a8959e7cd84809d/single/sol/sol.hpp
The text was updated successfully, but these errors were encountered: