Submitted a fix that catches yields and simulates the behavior of luaL_dostring
by copying over the remaining data.
If the code yields then 'run_lua' will return LUA_YIELD, allowing the caller to
decide what comes next.
Currently the return value is always ignored, so a yield will be equivalent to a
return.
Note that I'm unsure if this is a proper fix because I don't know:
1) if the code is meant to interact with the target state or the coroutine that
is currently running;
2) what should happen to the yielded/returned data. Note that the data might be
"polluting" the stack of the target and be a cause of problems somewhere else. |