diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2017-05-24 15:54:54 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2017-05-24 15:54:54 -0300 |
commit | be0d951be86ae7628ec22bb8b4b75870c21817ff (patch) | |
tree | f37a286abcd9988aa0e345c1b109d4652f178f4a /lfunc.c | |
parent | a9dbc2d64129d54379192b240623b41d8705a465 (diff) | |
download | lua-be0d951be86ae7628ec22bb8b4b75870c21817ff.tar.gz lua-be0d951be86ae7628ec22bb8b4b75870c21817ff.tar.bz2 lua-be0d951be86ae7628ec22bb8b4b75870c21817ff.zip |
bug: cannot reuse a dying upvalue
Diffstat (limited to 'lfunc.c')
-rw-r--r-- | lfunc.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lfunc.c,v 2.47 2017/04/11 18:41:09 roberto Exp roberto $ | 2 | ** $Id: lfunc.c,v 2.48 2017/04/30 20:43:26 roberto Exp roberto $ |
3 | ** Auxiliary functions to manipulate prototypes and closures | 3 | ** Auxiliary functions to manipulate prototypes and closures |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -63,7 +63,7 @@ UpVal *luaF_findupval (lua_State *L, StkId level) { | |||
63 | lua_assert(isintwups(L) || L->openupval == NULL); | 63 | lua_assert(isintwups(L) || L->openupval == NULL); |
64 | while ((p = *pp) != NULL && p->v >= level) { | 64 | while ((p = *pp) != NULL && p->v >= level) { |
65 | lua_assert(upisopen(p)); | 65 | lua_assert(upisopen(p)); |
66 | if (p->v == level) /* found a corresponding upvalue? */ | 66 | if (p->v == level && !isdead(G(L), p)) /* corresponding upvalue? */ |
67 | return p; /* return it */ | 67 | return p; /* return it */ |
68 | pp = &p->u.open.next; | 68 | pp = &p->u.open.next; |
69 | } | 69 | } |