From: Thierry FOURNIER Date: Thu, 12 Mar 2015 17:27:10 +0000 (+0100) Subject: BUG/MEDIUM: lua: bad argument number in analyser and in error message X-Git-Tag: v1.6-dev2~331 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=53dd3cf76bde80a001740eaa3ff30d59105ef33a;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: lua: bad argument number in analyser and in error message The first argument in the stack is 1 and not 0. So the analyzer starts at bad argument number, and the error message contains also bad argument number. --- diff --git a/src/hlua.c b/src/hlua.c index b23eb02eea..d59a462d5d 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -2564,7 +2564,7 @@ __LJMP static int hlua_run_sample_fetch(lua_State *L) args[i].type = ARGT_STOP; /* Check arguments. */ - MAY_LJMP(hlua_lua2arg_check(L, 1, args, f->arg_mask)); + MAY_LJMP(hlua_lua2arg_check(L, 2, args, f->arg_mask, s->p)); /* Run the special args checker. */ if (f->val_args && !f->val_args(args, NULL)) { @@ -2668,7 +2668,7 @@ __LJMP static int hlua_run_sample_conv(lua_State *L) args[i].type = ARGT_STOP; /* Check arguments. */ - MAY_LJMP(hlua_lua2arg_check(L, 1, args, conv->arg_mask)); + MAY_LJMP(hlua_lua2arg_check(L, 3, args, conv->arg_mask, sc->p)); /* Run the special args checker. */ if (conv->val_args && !conv->val_args(args, conv, "", 0, NULL)) {