benilla-re systems structs docs

luaL_getmetafield

function · lua · boundary

Address
0x6f4d00 · 95 bytes, up to 0x6f4d5e
Meaning
Pushes a field of the metatable of a value, returning 0 when there is none
Confidence
verified, proof one
Finding
lua/auxlib#metatables-and-fields

Finding: Metatables and fields in lua: the auxiliary library

luaL_newmetatable makes the registry entry of a type name, storing the table under the name and the name under the table, and answers 0 when it exists. luaL_getmetatable reads it, luaL_checkudata answers the block of a userdata whose metatable is registered under a name, and luaL_getmetafield and luaL_callmeta read and call a metatable field. luaL_findstring returns the position of a string in a null-ended list.

functionnamedecided by
0x6f4980luaL_findstringthe compare loop steps both pointers by 2 (0x6f49ab), -1 at the list end (0x6f49cb)
0x6f49e0luaL_newmetatablelua_rawget (0x6f49f2), lua_newtable (0x6f4a18), two lua_rawset (0x6f4a39, 0x6f4a58)
0x6f4a70luaL_getmetatablelua_pushstring then a tail jmp to lua_rawget (0x6f4a80)
0x6f4a90luaL_checkudatalua_getmetatable (0x6f4a99), lua_rawget on the registry (0x6f4aa9), lua_tostring, compare, lua_touserdata (0x6f4afe)
0x6f4d00luaL_getmetafieldlua_getmetatable (0x6f4d06), lua_rawget (0x6f4d25), lua_remove of the metatable (0x6f4d50)
0x6f4d60luaL_callmetaluaL_getmetafield (0x6f4d86), lua_pushvalue (0x6f4d99), lua_call (0x6f4da7)

The derivation is in the doc.

Callers 3

Callees 6

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