aboutsummaryrefslogtreecommitdiff
path: root/lfunc.c
diff options
context:
space:
mode:
Diffstat (limited to 'lfunc.c')
-rw-r--r--lfunc.c3
1 files changed, 2 insertions, 1 deletions
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) {
138 if (prepclosingmethod(L, uv, &G(L)->nilvalue)) /* something to call? */ 138 if (prepclosingmethod(L, uv, &G(L)->nilvalue)) /* something to call? */
139 callclose(L, NULL); /* call closing method */ 139 callclose(L, NULL); /* call closing method */
140 else if (!ttisnil(uv)) { /* non-closable non-nil value? */ 140 else if (!ttisnil(uv)) { /* non-closable non-nil value? */
141 const char *vname = luaG_findlocal(L, L->ci, level - L->ci->func, NULL); 141 int idx = cast_int(level - L->ci->func);
142 const char *vname = luaG_findlocal(L, L->ci, idx, NULL);
142 if (vname == NULL) vname = "?"; 143 if (vname == NULL) vname = "?";
143 luaG_runerror(L, "attempt to close non-closable variable '%s'", vname); 144 luaG_runerror(L, "attempt to close non-closable variable '%s'", vname);
144 } 145 }