diff options
Diffstat (limited to 'lfunc.c')
| -rw-r--r-- | lfunc.c | 3 |
1 files changed, 2 insertions, 1 deletions
| @@ -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 | } |
