MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / treatstackoption

Function treatstackoption

src/Chain/libraries/glua/ldblib.cpp:129–135  ·  view source on GitHub ↗

** In function 'db_getinfo', the call to 'lua_getinfo' may push ** results on the stack; later it creates the result table to put ** these objects. Function 'treatstackoption' puts the result from ** 'lua_getinfo' on top of the result table so that it can call ** 'lua_setfield'. */

Source from the content-addressed store, hash-verified

127** 'lua_setfield'.
128*/
129static void treatstackoption(lua_State *L, lua_State *L1, const char *fname) {
130 if (L == L1)
131 lua_rotate(L, -2, 1); /* exchange object and table */
132 else
133 lua_xmove(L1, L, 1); /* move object to the "main" stack */
134 lua_setfield(L, -2, fname); /* put object into table */
135}
136
137
138/*

Callers 1

db_getinfoFunction · 0.85

Calls 3

lua_rotateFunction · 0.85
lua_xmoveFunction · 0.85
lua_setfieldFunction · 0.85

Tested by

no test coverage detected