MCPcopy Create free account
hub / github.com/DFHack/dfhack / swapextra

Function swapextra

depends/lua/src/ldebug.c:62–69  ·  view source on GitHub ↗

** If function yielded, its 'func' can be in the 'extra' field. The ** next function restores 'func' to its correct value for debugging ** purposes. (It exchanges 'func' and 'extra'; so, when called again, ** after debugging, it also "re-restores" ** 'func' to its altered value. */

Source from the content-addressed store, hash-verified

60** after debugging, it also "re-restores" ** 'func' to its altered value.
61*/
62static void swapextra (lua_State *L) {
63 if (L->status == LUA_YIELD) {
64 CallInfo *ci = L->ci; /* get function that yielded */
65 StkId temp = ci->func; /* exchange its 'func' and 'extra' values */
66 ci->func = restorestack(L, ci->extra);
67 ci->extra = savestack(L, temp);
68 }
69}
70
71
72/*

Callers 3

lua_getlocalFunction · 0.85
lua_setlocalFunction · 0.85
lua_getinfoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected