From: Thierry FOURNIER Date: Sun, 27 Sep 2015 23:02:01 +0000 (+0200) Subject: BUG/MEDIUM: lua: don't reset undesired flags in hlua_ctx_resume X-Git-Tag: v1.6-dev6~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f3867f429a7a7f04b54a614d85291831736da83;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: lua: don't reset undesired flags in hlua_ctx_resume Some flags like HLUA_MUST_GC must not be cleared otherwise sessions are not properly cleaned. --- diff --git a/src/hlua.c b/src/hlua.c index d205a38798..2682129b58 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -1034,8 +1034,6 @@ static enum hlua_exec hlua_ctx_resume(struct hlua *lua, int yield_allowed) int ret; const char *msg; - HLUA_SET_RUN(lua); - /* If we want to resume the task, then check first the execution timeout. * if it is reached, we can interrupt the Lua processing. */ @@ -1050,7 +1048,10 @@ resume_execution: lua_sethook(lua->T, hlua_hook, LUA_MASKCOUNT, hlua_nb_instruction); /* Remove all flags except the running flags. */ - lua->flags = HLUA_RUN; + HLUA_SET_RUN(lua); + HLUA_CLR_CTRLYIELD(lua); + HLUA_CLR_WAKERESWR(lua); + HLUA_CLR_WAKEREQWR(lua); /* Call the function. */ ret = lua_resume(lua->T, gL.T, lua->nargs);