[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Lua 5.4's OP_RETURN, C operand
- From: Roberto Ierusalimschy <roberto@...>
- Date: Tue, 28 Sep 2021 09:25:20 -0300
> For luac.nl and its future back-end, I am studying all opcodes from the 5.*
> range of Lua versions. In Lua 5.4, OP_RETURN has ABCk format, I was
> wondering what C is for specifically as I can't really understand it fully
> from the source.
Did you see the notes in lopcodes.h?
(*) In instructions OP_RETURN/OP_TAILCALL, 'k' specifies that the
function builds upvalues, which may need to be closed. C > 0 means
the function is vararg, so that its 'func' must be corrected before
returning; in this case, (C - 1) is its number of fixed parameters.