benilla-re systems structs docs

luaV_gettable

function · lua · boundary

Address
0x6f7cf0 · 99 bytes, up to 0x6f7d52
Meaning
Reads a key of a value through __index, following tables up to 100 times
Confidence
verified, proof one
Finding
lua/runtime#metamethod-access

Finding: Metamethod access in lua: calls, states and the collector

Indexing goes through luaV_gettable and luaV_settable. luaV_gettable reads a table directly and, for a nil result, follows the __index of its metatable (luaV_index); a value that is no table asks luaV_getnotable for __index, which raises attempt to index when there is none. A function metamethod is called through callTMres (one result) or callTM (none), a table is indexed again, at most 100 times (loop in gettable, loop in settable). call_binTM tries the metamethod of each operand of an operator.

functionnamedecided by
0x6f7cf0luaV_gettableloop limit 100 (0x6f7cf7), loop in gettable (0x6f7d08), table test (0x6f7d10), luaH_get (0x6f7d1d), luaV_index (0x6f7d31), luaV_getnotable (0x6f7d47)
0x6f7d60luaV_indexcached absence flag (0x6f7d6f), luaT_gettm (0x6f7d81), function tag (0x6f7d97) to callTMres (0x6f7da3), else luaV_gettable (0x6f7db8)
0x6f7ba0luaT_gettmluaH_getstr (0x6f7bac), nil result sets bit event of [t+6] (0x6f7bbc) and answers null
0x6f7dd0callTMresthree 16-byte pushes, growth check (0x6f7ea4), luaD_call with one result (0x6f7ec7)
0x6f7ee0luaV_getnotableluaT_gettmbyobj (0x6f7eec), nil raises index (0x6f7f01), function to callTMres (0x6f7f14), else luaV_gettable (0x6f7f2f)
0x6f7f40luaV_settableluaH_set (0x6f7f64), flag test (0x6f7f74), luaT_gettm (0x6f7f8b), luaT_gettmbyobj (0x6f7fd7), limit (0x6f7ffa), callTM (0x6f802c)
0x6f8040callTMfour 16-byte pushes, growth check (0x6f8158), luaD_call with no result (0x6f817b)
0x6f8670call_binTMluaT_gettmbyobj twice (0x6f8684, 0x6f8697), function test (0x6f869c), callTMres (0x6f86b3)

The derivation is in the doc.

Callers 3

Callees 4

Calls and jumps by a bare address, from tables/calls.tsv.