luaV_equalval
function · lua · boundary
- Address
0x6f8330· 231 bytes, up to0x6f8416- Meaning
- Compares two values of the same tag, calling __eq for tables and userdata
- Confidence
- verified, proof one
- Finding
- lua/runtime#order-equality-and-arithmetic
Finding: Order, equality and arithmetic in lua: calls, states and the collector
Comparisons: luaV_lessthan and luaV_lessequal compare numbers by value and strings through
luaV_strcmp (strcoll over embedded zeros), else try __lt or __le through call_orderTM
(__le falls back to the negated __lt with swapped operands) and raise luaG_ordererror.
luaV_equalval compares by tag, then values, then __eq through get_compTM. luaV_concat
joins the top values, strings and numbers directly and others through __concat. Arith performs
+ - * / ^ on numbers, the metamethod, or luaG_aritherror; ^ calls the global __pow.
traceexec calls the count and line hooks.
| function | name | decided by |
|---|---|---|
0x6f8190 | luaV_lessthan | number tag (0x6f81a3), fcom parity test (0x6f81b2), string tag (0x6f81cc), luaV_strcmp (0x6f81d7), call_orderTM (0x6f81f3), luaG_ordererror (0x6f8202) |
0x6f99e0 | luaV_lessequal | numbers (0x6f99f3, 0x6f9a02), strings (0x6f9a1c, 0x6f9a27), call_orderTM for __le (0x6f9a43) and __lt (0x6f9a54), luaG_ordererror (0x6f9a73) |
0x6f8210 | call_orderTM | luaT_gettmbyobj (0x6f821e, 0x6f823d), luaO_rawequalObj (0x6f8246), callTMres (0x6f8262), truth test (0x6f8270) |
0x6f82a0 | luaV_strcmp | strcoll (0x6f82bd, 0x6f82fe) |
0x6f8330 | luaV_equalval | tag switch (0x6f8339), number compare (0x6f8359), get_compTM (0x6f83c4), callTMres (0x6f83dc), truth test (0x6f83ea) |
0x6f8440 | get_compTM | luaT_gettm for each (0x6f846e, 0x6f84a1), equal metatables (0x6f8481), luaO_rawequalObj (0x6f84bc) |
0x6f84d0 | luaV_concat | luaV_tostring (0x6f8507, 0x6f851e), call_binTM (0x6f8533), luaG_concaterror (0x6f8546), string size overflow (0x6f85ad), luaS_newlstr (0x6f8635) |
0x6f9a80 | Arith | luaV_tonumber twice (0x6f9a93, 0x6f9aa8), operator switch, __pow lookup (0x6f9b5e), call_binTM (0x6f9bf3), luaG_aritherror (0x6f9c01) |
0x6f9900 | traceexec | mask above 4 (0x6f990b), luaD_callhook (0x6f9926), line mask test (0x6f9932), luaG_inithooks (0x6f9970), luaD_callhook (0x6f99bb) |
The derivation is in the doc.
Callers 2
- lua_equal lua
- luaV_execute lua
Callees 2
- callTMres lua
- get_compTM lua
Calls and jumps by a bare address, from tables/calls.tsv.