Message ID | 20181017124649.25843-1-christian.storm@siemens.com |
---|---|
State | Accepted |
Headers | show |
Series | Lua: remove stack leftover in l_handler_wrapper() | expand |
On 17/10/18 14:46, Christian Storm wrote: > The function l_handler_wrapper() is called by C code > only, hence there's no need to leave a return value > on Lua's stack. > > Signed-off-by: Christian Storm <christian.storm@siemens.com> > --- > corelib/lua_interface.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/corelib/lua_interface.c b/corelib/lua_interface.c > index 3155174..94fc981 100644 > --- a/corelib/lua_interface.c > +++ b/corelib/lua_interface.c > @@ -938,6 +938,7 @@ static int l_handler_wrapper(struct img_type *img, void *data) { > } > > result = lua_tonumber(gL, -1); > + lua_pop(gL, 1); > TRACE("[Lua handler] returned: %d",(int)result); > > return (int) result; > Applied to -master, thanks ! Best regards, Stefano Babic
diff --git a/corelib/lua_interface.c b/corelib/lua_interface.c index 3155174..94fc981 100644 --- a/corelib/lua_interface.c +++ b/corelib/lua_interface.c @@ -938,6 +938,7 @@ static int l_handler_wrapper(struct img_type *img, void *data) { } result = lua_tonumber(gL, -1); + lua_pop(gL, 1); TRACE("[Lua handler] returned: %d",(int)result); return (int) result;
The function l_handler_wrapper() is called by C code only, hence there's no need to leave a return value on Lua's stack. Signed-off-by: Christian Storm <christian.storm@siemens.com> --- corelib/lua_interface.c | 1 + 1 file changed, 1 insertion(+)