From cf71a5ddc742692fad813f89f1c9ef53e1ffde0f Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 13 Mar 2019 13:16:53 -0300 Subject: Details Several small improvements (code style, warnings, comments, more tests), in particular: - 'lua_topointer' extended to handle strings - raises an error in 'string.format("%10q")' ('%q' with modifiers) - in the manual for 'string.format', the term "option" replaced by "conversion specifier" (the term used by the C standard) --- lfunc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lfunc.c') diff --git a/lfunc.c b/lfunc.c index 362b798c..3e044b65 100644 --- a/lfunc.c +++ b/lfunc.c @@ -138,7 +138,8 @@ static int callclosemth (lua_State *L, TValue *uv, StkId level, int status) { if (prepclosingmethod(L, uv, &G(L)->nilvalue)) /* something to call? */ callclose(L, NULL); /* call closing method */ else if (!ttisnil(uv)) { /* non-closable non-nil value? */ - const char *vname = luaG_findlocal(L, L->ci, level - L->ci->func, NULL); + int idx = cast_int(level - L->ci->func); + const char *vname = luaG_findlocal(L, L->ci, idx, NULL); if (vname == NULL) vname = "?"; luaG_runerror(L, "attempt to close non-closable variable '%s'", vname); } -- cgit v1.2.3-55-g6feb