lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hello,

 

Does any one know whether it is safe to use lua_xmove() when both the source and destination states represent the same state and, if it is safe, does this operation leave the stack unchanged (as intuitively expected)?

 

<background info>

I am implementing a Lua debugger for one of our applications. In my implementation, a script is run as a coroutine by invoking lua_resume() while being debugged and run on the main Lua state with lua_pcall() when it’s not being debugged.

The decision to debug the script or not is done at run-time by reading from a properties file.

As the C-side (actually Delphi-side) code uses lua_xmove() in a few places, I could keep the code uncluttered by simply ignoring the fact that the ‘from’ and ‘to’ arguments of lua_xmove() are one and the same state. The two states would coincide when the script is not being debugged and I would expect that such an operation would result in no changes made to the stack.

</background info>

 

Thanks

Marius Gheorghe