You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
That prints Lua nil on the python side instead of the function value of math.sin. Likewise when passing an empty table eg. pyprint({}, 1)}.
The problem is in LuaObject_New, it always uses the same global lua_State. This creates a problem when using coroutines since a different lua_State is used -- pushing arguments to the global state context is wrong in this scenario resulting in 'lost' parameters. Simple primitive types are fine but any non-trivial types like tables, functions, udata, other coroutines etc. that involves LuaObject_New during conversion will be affected by this bug.
The text was updated successfully, but these errors were encountered:
greatwolf
added a commit
to greatwolf/lunatic-python
that referenced
this issue
Feb 12, 2017
The follow reproduces the problem:
That prints
Lua nil
on the python side instead of the function value ofmath.sin
. Likewise when passing an empty table eg.pyprint({}, 1)}
.The problem is in
LuaObject_New
, it always uses the same globallua_State
. This creates a problem when using coroutines since a differentlua_State
is used -- pushing arguments to the global state context is wrong in this scenario resulting in 'lost' parameters. Simple primitive types are fine but any non-trivial types like tables, functions, udata, other coroutines etc. that involvesLuaObject_New
during conversion will be affected by this bug.The text was updated successfully, but these errors were encountered: