statement
function · lua · boundary
- Address
0x6fcd60· 232 bytes, up to0x6fce47- Meaning
- Parses one statement by its first token and answers whether it must be the last of its block
- Confidence
- verified, proof one
- Finding
- lua/compiler#function-states-and-blocks
Finding: Function states and blocks in lua: the compiler
open_func starts a function state with a new prototype and constant table, no pending jumps and a
stack of two registers; close_func appends the final return and trims the code, line, constant,
nested-prototype, local and upvalue vectors to their used sizes. chunk parses statements until
block_follow sees else, elseif, end, until or the end, resetting the free register after
each, and allows 200 nested levels. body compiles a function into a new prototype that
pushclosure adds to its parent.
| function | name | decided by |
|---|---|---|
0x6fca90 | open_func | luaF_newproto (0x6fca9a), pending jumps -1 (0x6fcabd), luaH_new (0x6fcad0), stack size 2 (0x6fcaee) |
0x6fcb00 | close_func | removevars 0 (0x6fcb14), OP_RETURN 0 1 0 (0x6fcb26), six luaM_irealloc (0x6fcb48..0x6fcc26) |
0x6fcc90 | chunk | level above 200 (0x6fcc99), block_follow (0x6fccb3), statement (0x6fccbe), ; (0x6fcccc), free register reset (0x6fccd9) |
0x6fcd10 | block_follow | byte-table switch over 260 to 287 (0x6fcd16, 0x6fcd22) |
0x6fcd60 | statement | byte-table switch over 258 to 277 (0x6fcd6b, 0x6fcd7f), 1 after return and break (0x6fce26, 0x6fce35), else exprstat (0x6fce3e) |
0x6fcf20 | block | enterblock 0 (0x6fcf34), chunk (0x6fcf3b), leaveblock (0x6fcf42) |
0x6fcf50 | enterblock | break list -1 (0x6fcf56), the block linked in (0x6fcf72) |
0x6fcf80 | leaveblock | removevars (0x6fcf92), OP_CLOSE for an upvalue (0x6fcfad), tail jmp to luaK_patchtohere (0x6fcfbf) |
0x6fd7c0 | body | open_func (0x6fd7d6), self (0x6fd801), parlist (0x6fd808), chunk (0x6fd81b), close_func (0x6fd834), pushclosure (0x6fd842) |
0x6fd980 | pushclosure | luaM_growaux (0x6fd9af), OP_CLOSURE (0x6fd9d6), OP_MOVE or OP_GETUPVAL per upvalue (0x6fd9fe..0x6fda0f) |
0x6fda30 | parlist | names (0x6fda6b), ... (0x6fda4d), <name> or `...' expected (0x6fda52), code_params (0x6fda85, 0x6fda9d) |
The derivation is in the doc.
Callers 1
- chunk lua
Callees 14
- next lua
- testnext lua
- check_match lua
- block lua
- whilestat lua
- repeatstat lua
- forstat lua
- ifstat lua
- localfunc lua
- localstat lua
- funcstat lua
- exprstat lua
- retstat lua
- breakstat lua
Calls and jumps by a bare address, from tables/calls.tsv.