luaL_checknumber
function · lua · boundary
- Address
0x6f4c80· 68 bytes, up to0x6f4cc3- Meaning
- Returns the number of an argument, raising for a non-number
- 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.
| function | name | decided by |
|---|---|---|
0x6f4810 | luaL_argerror | lua_getstack (0x6f4824), lua_getinfo (0x6f4834), the text method (0x6f483c), the two formats |
0x6f48a0 | luaL_typerror | lua_type, lua_typename (0x6f48b2), the format %s expected, got %s (0x6f48bc) |
0x6f48e0 | luaL_where | lua_getstack (0x6f48ed), lua_getinfo with Snl (0x6f48fa), the format %s:%d: (0x6f4912) |
0x6f4b20 | luaL_checkstack | lua_checkstack (0x6f4b26), the format stack overflow (%s) (0x6f4b33) |
0x6f4b50 | luaL_checktype | lua_type compared with the argument (0x6f4b59), tag_error (0x6f4b6a) |
0x6f4b80 | tag_error | lua_typename (0x6f4b8c) then luaL_typerror (0x6f4b96) |
0x6f4bb0 | luaL_checkany | lua_type equal to -1 (0x6f4bbb), the text value expected (0x6f4bc0) |
0x6f4be0 | luaL_checklstring | lua_tostring (0x6f4bea), tag_error with tag 4 (0x6f4bfb), lua_strlen (0x6f4c0b) |
0x6f4c20 | luaL_optlstring | lua_type above 0 selects luaL_checklstring (0x6f4c6a), else the default and its length (0x6f4c40) |
0x6f4c80 | luaL_checknumber | lua_tonumber (0x6f4c8c), lua_isnumber only when it is 0.0 (0x6f4ca7), tag_error with tag 3 (0x6f4cb6) |
0x6f4cd0 | luaL_optnumber | lua_type (0x6f4cd9) selects luaL_checknumber (0x6f4cef) or the default |
The derivation is in the doc.
Callers 40
- luaL_optnumber lua
- bit_bnot lua
- bit_band lua
- bit_bor lua
- bit_bxor lua
- bit_lshift lua
- bit_rshift lua
- bit_arshift lua
- bit_mod lua
- bit_mod_remainder lua
- math_abs lua
- math_sin lua
- math_cos lua
- math_tan lua
- math_asin lua
- math_acos lua
- math_atan lua
- math_atan2 lua
- math_ceil lua
- math_floor lua
- math_mod lua
- math_sqrt lua
- math_pow lua
- math_log lua
- math_log10 lua
- math_exp lua
- math_deg lua
- math_rad lua
- math_frexp lua
- math_ldexp lua
- math_min lua
- math_max lua
- math_random lua
- math_randomseed lua
- luaB_setn lua
- luaB_tinsert lua
- str_sub lua
- str_rep lua
- str_char lua
- str_format lua
Callees 3
- lua_isnumber lua
- lua_tonumber lua
- tag_error lua
Calls and jumps by a bare address, from tables/calls.tsv.