[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: debug.getlocal from within return hook
- From: "书呆彭, Peng Yi" <nerditation@...>
- Date: Thu, 21 May 2015 10:58:48 +0800
在 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).
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