lua_pushvalue
function · lua · boundary
- Address
0x6f3350· 173 bytes, up to0x6f33fc- Meaning
- Pushes a copy of the value at an index
- Confidence
- verified, proof two
- Finding
- lua/api#stack-moves
Finding: Stack moves in lua: the C API
Seven functions move values on the stack. luaA_pushobject copies a value to the top and
makes room first, lua_xmove moves the top n values of one state onto another, lua_settop
sets the top (filling with nil), lua_remove and lua_insert shift the values above an index
down or up one slot, lua_replace pops the top into an index and lua_pushvalue pushes a copy
of an index. Each resolves its index by the same inlined walk: positive from the base, negative
from the top, -10000 the registry, -10001 the globals, below that an upvalue of the running C
function.
| function | name | decided by |
|---|---|---|
0x6f2ec0 | luaA_pushobject | copies 16 bytes to [L+8] (0x6f2ecc), calls luaD_growstack at 0x6f2f19, adds 16 at 0x6f2f24 |
0x6f2f80 | lua_xmove | lowers the first top by n*16 (0x6f2f9c), copies each to [to+8] and raises it (0x6f3007); ret 4 |
0x6f3080 | lua_settop | nil tag 0 stores at 0x6f309a, top from base at 0x6f30bb, negative index adds (idx+1)*16 at 0x6f30c5 |
0x6f30d0 | lua_remove | copy loop from idx+16 to idx (0x6f3140), top lowered by 16 at 0x6f318b |
0x6f31a0 | lua_insert | copy loop upward from the top (0x6f3218), top value stored at the index (0x6f326b) |
0x6f32b0 | lua_replace | copies [top-16] to the index slot, then add [ecx+8],-16 (0x6f3347) |
0x6f3350 | lua_pushvalue | copies the index slot to [L+8], then add [ecx+8],16 (0x6f33eb) |
The derivation is in the doc.
Callers 20
- luaL_newmetatable lua
- luaL_callmeta lua
- luaL_openlib lua
- luaL_setn lua
- getsizes lua
- luaL_getn lua
- ScriptError ui
- ScriptPushFunction ui
- ScriptSetFenv ui
- ScriptIpairs ui
- ScriptPairs ui
- ScriptToString ui
- FrameScriptSerializeValue ui
- luaB_foreachi lua
- luaB_foreach lua
- luaB_tinsert lua
- auxsort lua
- sort_comp lua
- add_s lua
- str_format lua
Callees 0
None by a direct call or jump.
Calls and jumps by a bare address, from tables/calls.tsv.