** 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'. */
| 132 | ** 'lua_setfield'. |
| 133 | */ |
| 134 | static 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 | /* |
no test coverage detected