diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2017-04-06 10:08:56 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2017-04-06 10:08:56 -0300 |
commit | 2331e1beec01babf78ca09fea8701b5bb3c78d4c (patch) | |
tree | d6d5a05daf5338b383e7c5681503272318a62958 /lfunc.c | |
parent | e4287da3a6b0b167da465fd449e5191b9ac9ef46 (diff) | |
download | lua-2331e1beec01babf78ca09fea8701b5bb3c78d4c.tar.gz lua-2331e1beec01babf78ca09fea8701b5bb3c78d4c.tar.bz2 lua-2331e1beec01babf78ca09fea8701b5bb3c78d4c.zip |
small changes in 'luaC_upvalbarrier'
Diffstat (limited to '')
-rw-r--r-- | lfunc.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lfunc.c,v 2.44 2014/10/25 11:50:46 roberto Exp roberto $ | 2 | ** $Id: lfunc.c,v 2.45 2014/11/02 19:19:04 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 | */ |
@@ -88,9 +88,10 @@ void luaF_close (lua_State *L, StkId level) { | |||
88 | if (uv->refcount == 0) /* no references? */ | 88 | if (uv->refcount == 0) /* no references? */ |
89 | luaM_free(L, uv); /* free upvalue */ | 89 | luaM_free(L, uv); /* free upvalue */ |
90 | else { | 90 | else { |
91 | setobj(L, &uv->u.value, uv->v); /* move value to upvalue slot */ | 91 | TValue *slot = &uv->u.value; /* new position for value */ |
92 | uv->v = &uv->u.value; /* now current value lives here */ | 92 | setobj(L, slot, uv->v); /* move value to upvalue slot */ |
93 | luaC_upvalbarrier(L, uv); | 93 | uv->v = slot; /* now current value lives here */ |
94 | luaC_upvalbarrier(L, uv, slot); | ||
94 | } | 95 | } |
95 | } | 96 | } |
96 | } | 97 | } |