benilla-re systems structs docs

luaL_typerror

function · lua · boundary

Address
0x6f48a0 · 58 bytes, up to 0x6f48d9
Meaning
Raises an argument error saying which type was expected and which was found
Confidence
verified, proof one
Finding
lua/auxlib#argument-checks

Finding: Argument checks in lua: the auxiliary library

Argument errors go through luaL_argerror, which names the function from lua_getinfo and raises with luaL_error: bad argument #%d to `%s' (%s), or calling `%s' on bad self (%s) when the name kind is method. luaL_typerror and tag_error make the X expected, got Y message from a type name or tag. The checks are luaL_checktype, luaL_checkany, luaL_checkstack, luaL_checklstring, luaL_checknumber and the optional forms luaL_optlstring and luaL_optnumber. luaL_where pushes chunk:line: of a call level.

functionnamedecided by
0x6f4810luaL_argerrorlua_getstack (0x6f4824), lua_getinfo (0x6f4834), the text method (0x6f483c), the two formats
0x6f48a0luaL_typerrorlua_type, lua_typename (0x6f48b2), the format %s expected, got %s (0x6f48bc)
0x6f48e0luaL_wherelua_getstack (0x6f48ed), lua_getinfo with Snl (0x6f48fa), the format %s:%d: (0x6f4912)
0x6f4b20luaL_checkstacklua_checkstack (0x6f4b26), the format stack overflow (%s) (0x6f4b33)
0x6f4b50luaL_checktypelua_type compared with the argument (0x6f4b59), tag_error (0x6f4b6a)
0x6f4b80tag_errorlua_typename (0x6f4b8c) then luaL_typerror (0x6f4b96)
0x6f4bb0luaL_checkanylua_type equal to -1 (0x6f4bbb), the text value expected (0x6f4bc0)
0x6f4be0luaL_checklstringlua_tostring (0x6f4bea), tag_error with tag 4 (0x6f4bfb), lua_strlen (0x6f4c0b)
0x6f4c20luaL_optlstringlua_type above 0 selects luaL_checklstring (0x6f4c6a), else the default and its length (0x6f4c40)
0x6f4c80luaL_checknumberlua_tonumber (0x6f4c8c), lua_isnumber only when it is 0.0 (0x6f4ca7), tag_error with tag 3 (0x6f4cb6)
0x6f4cd0luaL_optnumberlua_type (0x6f4cd9) selects luaL_checknumber (0x6f4cef) or the default

The derivation is in the doc.

Callers 1

Callees 4

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