lua-users home
lua-l archive

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


在 2015/5/20 20:51, Roberto Ierusalimschy 写道:
actually I found it totally unnecessary to adjust the stack top pointer.
anyway `luaD_poscall` is doing the work of moving the return values
to the caller's frame, whether or not a hook is called.
Currently, the stack pointer is what tells `luaD_poscall` how many
values should be returned (all values from 'firstresult' up to the top).

-- Roberto



maybe we could just pass that parameter explicitly, instead of multi-use
the stack pointer, and leave the stack pointer for the active frame.

  int luaD_poscall (lua_State *L, StkId firstresult, StkId lastresult);


--
the nerdy Peng / 书呆彭 / Sent from Thunderbird