checkRK
function · lua · boundary
- Address
0x6fc430· 38 bytes, up to0x6fc455- Meaning
- Answers whether an operand is a valid register or constant of a prototype
- Confidence
- verified, proof one
- Finding
- lua/chunks#the-code-checker
Finding: The code checker in lua: precompiled chunks
luaG_symbexec walks a prototype's instructions up to a pc and returns the last one before it that
set a given register, refusing malformed code with 0: a register at or above the stack size, an
operand that is no register or constant, a constant index past the constants, a test not followed by
OP_JMP, a jump out of the code, a wrong instruction after an open call, a closure's upvalue
instructions other than OP_MOVE or OP_GETUPVAL. precheck requires a stack of at most 250, as
many lines as instructions or none, and a final OP_RETURN. luaG_checkcode runs it over the whole
code with no register.
| function | name | decided by |
|---|---|---|
0x6fc000 | luaG_checkcode | size of code and register 255 (0x6fc000, 0x6fc003), luaG_symbexec (0x6fc008) |
0x6fc010 | luaG_symbexec | precheck (0x6fc027), A (0x6fc069), mode (0x6fc075..0x6fc09e), operands (0x6fc0d6..0x6fc114), sets A (0x6fc12d..0x6fc139), test then jump (0x6fc13f..0x6fc15c), opcode switch (0x6fc16a..0x6fc17d), result (0x6fc362, 0x6fc365) |
0x6fc3d0 | precheck | 250 (0x6fc3d0), line count (0x6fc3d9..0x6fc3e5), OP_RETURN (0x6fc3ed..0x6fc3f9) |
0x6fc400 | checkopenop | call, tail call or return with B 0 (0x6fc40c..0x6fc428), OP_SETLISTO (0x6fc416) |
0x6fc430 | checkRK | below the stack size (0x6fc434), or 250 up and below the constants (0x6fc438..0x6fc44b) |
The derivation is in the doc.
Callers 1
- luaG_symbexec lua
Callees 0
None by a direct call or jump.
Calls and jumps by a bare address, from tables/calls.tsv.