callrethooks
function · lua · boundary
- Address
0x6f6540· 84 bytes, up to0x6f6593- Meaning
- Calls the return hook and the tail-return hooks of the current call
- Confidence
- verified, proof one
- Finding
- lua/runtime#stack-and-call-records
Finding: Stack and call records in lua: calls, states and the collector
The stack and the call-record vector grow by reallocation. luaD_growstack doubles the stack
or adds the needed size plus five, luaD_reallocstack makes the new stack and correctstack
rebases the top, the open upvalues and every call record. luaD_reallocCI resizes the records,
luaD_growCI doubles them and raises stack overflow when the new size passes 4096,
restore_stack_limit resets the limits after an error. luaD_call counts C nesting, runs
luaD_precall and the machine, then luaD_poscall, which moves the results down and pads with
nil. tryfuncTM makes a non-function callable through __call and adjust_varargs builds the
arg table.
| function | name | decided by |
|---|---|---|
0x6f5e20 | luaD_reallocstack | luaM_irealloc in ldo.c (0x6f5e45), stack_last six slots before the end (0x6f5e4d), tail jmp to correctstack (0x6f5e62) |
0x6f5e70 | correctstack | top (0x6f5e81), open upvalue list [L+0x50] (0x6f5e84), call records 0x18 apart (0x6f5ed8), base (0x6f5ee5) |
0x6f5ef0 | luaD_reallocCI | luaM_irealloc in ldo.c for 24 bytes a record (0x6f5f1a), division by 24 (0x6f5f2b) |
0x6f5f60 | luaD_growstack | compare (0x6f5f63), double (0x6f5f67), size plus n plus 5 (0x6f5f6f), both ending in luaD_reallocstack |
0x6f61c0 | luaD_growCI | size test 4096 (0x6f61c7), luaD_throw tail (0x6f61d3), luaD_reallocCI (0x6f61df), stack overflow (0x6f61f2) |
0x6f6200 | adjust_varargs | luaH_new (0x6f6266), luaH_setnum (0x6f6294), the key n (0x6f62f2), luaH_set (0x6f6302) |
0x6f6370 | tryfuncTM | luaT_gettmbyobj (0x6f6382), tag 6 test (0x6f6393), call (0x6f639b), luaG_typeerror (0x6f63a4) |
0x6f6470 | luaD_poscall | return hook test (0x6f6479), callrethooks (0x6f648b), record popped (0x6f649c), result copy (0x6f64b2), nil fill (0x6f6517) |
0x6f6540 | callrethooks | luaD_callhook event 1 (0x6f6550), event 4 per tail call (0x6f6574) |
0x6f65a0 | luaD_call | limit 200 (0x6f65ae), C stack overflow (0x6f65bf), luaD_throw 5 (0x6f65cf), luaD_precall (0x6f65df), luaV_execute (0x6f65ea), luaD_poscall (0x6f65f5) |
0x6f6760 | restore_stack_limit | stack_last from the size (0x6f6773), 4096 test (0x6f6769), tail jmp to luaD_reallocCI (0x6f67a0) |
The derivation is in the doc.
Callers 1
- luaD_poscall lua
Callees 1
- luaD_callhook lua
Calls and jumps by a bare address, from tables/calls.tsv.