aboutsummaryrefslogtreecommitdiff
path: root/lfunc.c
diff options
context:
space:
mode:
Diffstat (limited to 'lfunc.c')
-rw-r--r--lfunc.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/lfunc.c b/lfunc.c
index 4c10230e..0f839e7c 100644
--- a/lfunc.c
+++ b/lfunc.c
@@ -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}