We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
LuaObject中checkUD模板下使用luaL_getmetafield从元表中获取值,成功之后tostring,然后再执行lua_pop,正常流程没问题。可是如果luaL_getmetafield失败后,再去执行lua_pop,而luaL_getmetafield失败时什么也不会压栈,不就破坏了栈吗?
The text was updated successfully, but these errors were encountered:
luaL_getmetafield 失败也会push一个nil的
Sorry, something went wrong.
最初是在云风翻译的中文文档下看到的luaL_getmetafield失败不压栈,刚才去看了下lua-5.3.5源码,luaL_getmetafield先调用的lua_getmetatable去获取元表,而lua_getmetatable失败时也不进行压栈操作,那luaL_getmetafield也应该失败时不压栈吧,还是我哪里理解有问题,如果有的话,大佬指点下,谢谢。另外,QQ群申请同意一下呢,想和大家一起学习
嗯,我看了下代码,确实不push nil,我fix一下,谢谢指出。
70458b2
fix #290
6b8155e
No branches or pull requests
LuaObject中checkUD模板下使用luaL_getmetafield从元表中获取值,成功之后tostring,然后再执行lua_pop,正常流程没问题。可是如果luaL_getmetafield失败后,再去执行lua_pop,而luaL_getmetafield失败时什么也不会压栈,不就破坏了栈吗?
The text was updated successfully, but these errors were encountered: