lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

> For 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.

-- Roberto