benilla-re systems structs docs

luaA_indexAcceptable

function · lua · boundary

Address
0x6f3410 · 101 bytes, up to 0x6f3474
Meaning
Resolves a stack or pseudo index to its slot, null for an index past the top
Confidence
verified, proof two
Finding
lua/api#index-lookup-and-tests

Finding: Index lookup and tests in lua: the C API

luaA_indexAcceptable resolves an index to its slot and answers null where upstream's acceptable-index rule does: a positive index at or past the top, and an upvalue past the running function's count. lua_typename maps a tag to its name and -1 to no value. The five tests answer 0 or 1: lua_iscfunction for a function with a C body, lua_isuserdata for tags 7 and 2, lua_rawequal through the raw comparison, lua_equal when the tags match and luaV_equalval agrees, lua_lessthan through luaV_lessthan. A null slot answers 0.

functionnamedecided by
0x6f3410luaA_indexAcceptablecmp edx,[ecx+8] with sbb eax,eax; and eax,edx (0x6f341e) nulls a positive slot at or past the top
0x6f3480lua_typenamecmp edx,-1 (0x6f3480), the name table s_luaTypeNames indexed at 0x6f348a
0x6f34a0lua_iscfunctiontag 6 at 0x6f34a9, then the C-closure byte at closure+6
0x6f3530lua_isuserdatacompares the tag with 7 (0x6f353b) and 2
0x6f3550lua_rawequalcalls luaO_rawequalObj (0x6f3574) only when both slots are non-null
0x6f3590lua_equaltags compared, then luaV_equalval (0x6f35bb)
0x6f35e0lua_lessthancalls luaV_lessthan (0x6f3605) only when both slots are non-null

The derivation is in the doc.

Callers 16

Callees 0

None by a direct call or jump.

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