MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / luaK_setreturns

Function luaK_setreturns

3rd/lua-5.4.3/src/lcode.c:703–713  ·  view source on GitHub ↗

** Fix an expression to return the number of results 'nresults'. ** 'e' must be a multi-ret expression (function call or vararg). */

Source from the content-addressed store, hash-verified

701** 'e' must be a multi-ret expression (function call or vararg).
702*/
703void luaK_setreturns (FuncState *fs, expdesc *e, int nresults) {
704 Instruction *pc = &getinstruction(fs, e);
705 if (e->k == VCALL) /* expression is an open function call? */
706 SETARG_C(*pc, nresults + 1);
707 else {
708 lua_assert(e->k == VVARARG);
709 SETARG_C(*pc, nresults + 1);
710 SETARG_A(*pc, fs->freereg);
711 luaK_reserveregs(fs, 1);
712 }
713}
714
715
716/*

Callers 1

adjust_assignFunction · 0.85

Calls 1

luaK_reserveregsFunction · 0.85

Tested by

no test coverage detected