lua lua_settable
void lua_settable (lua_State *L, int index);
Does the equivalent to t[k] = v
, where t
is the value at the given index, v
is the value at the top of the stack, and k
is the value just below the top.
This function pops both the key and the value from the stack. As in Lua, this function may trigger a metamethod for the "newindex" event (see §2.4).
lua_settable 前栈情况
-----------------top-------------------
`Val'
1
table
-----------------end-------------------
lua_settable(L, -3) 之后
-----------------top-------------------
table
-----------------end-------------------
本博客注有“转”字样的为转载文章,其余为本人原创文章,转载请务必注明出处或保存此段。c++/lua/windows逆向交流群:69148232