mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-07 15:47:01 +02:00
BUG/MINOR: lua: return bad error messages
The returned type is the type of the top of stack value and not the type of the checked argument. [wt: this can be backported to 1.8, 1.7 and 1.6]
This commit is contained in:
parent
29a05c13d1
commit
fd1e955a56
@ -269,7 +269,7 @@ __LJMP static int hlua_http_get_headers(lua_State *L, struct hlua_txn *htxn, str
|
||||
__LJMP unsigned int hlua_checkfunction(lua_State *L, int argno)
|
||||
{
|
||||
if (!lua_isfunction(L, argno)) {
|
||||
const char *msg = lua_pushfstring(L, "function expected, got %s", luaL_typename(L, -1));
|
||||
const char *msg = lua_pushfstring(L, "function expected, got %s", luaL_typename(L, argno));
|
||||
WILL_LJMP(luaL_argerror(L, argno, msg));
|
||||
}
|
||||
lua_pushvalue(L, argno);
|
||||
|
Loading…
Reference in New Issue
Block a user