MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / treatstackoption

Function treatstackoption

extlibs/lua/src/ldblib.c:134–140  ·  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

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

Callers 1

db_getinfoFunction · 0.85

Calls 3

lua_xmoveFunction · 0.85
lua_setfieldFunction · 0.85
lua_rotateFunction · 0.70

Tested by

no test coverage detected