aboutsummaryrefslogtreecommitdiff
path: root/lapi.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2017-04-06 10:08:56 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2017-04-06 10:08:56 -0300
commit2331e1beec01babf78ca09fea8701b5bb3c78d4c (patch)
treed6d5a05daf5338b383e7c5681503272318a62958 /lapi.c
parente4287da3a6b0b167da465fd449e5191b9ac9ef46 (diff)
downloadlua-2331e1beec01babf78ca09fea8701b5bb3c78d4c.tar.gz
lua-2331e1beec01babf78ca09fea8701b5bb3c78d4c.tar.bz2
lua-2331e1beec01babf78ca09fea8701b5bb3c78d4c.zip
small changes in 'luaC_upvalbarrier'
Diffstat (limited to 'lapi.c')
-rw-r--r--lapi.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lapi.c b/lapi.c
index 494fce75..25ed81fd 100644
--- a/lapi.c
+++ b/lapi.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lapi.c,v 2.259 2016/02/29 14:27:14 roberto Exp roberto $ 2** $Id: lapi.c,v 2.260 2017/02/23 21:07:34 roberto Exp roberto $
3** Lua API 3** Lua API
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -1004,7 +1004,7 @@ LUA_API int lua_load (lua_State *L, lua_Reader reader, void *data,
1004 const TValue *gt = luaH_getint(reg, LUA_RIDX_GLOBALS); 1004 const TValue *gt = luaH_getint(reg, LUA_RIDX_GLOBALS);
1005 /* set global table as 1st upvalue of 'f' (may be LUA_ENV) */ 1005 /* set global table as 1st upvalue of 'f' (may be LUA_ENV) */
1006 setobj(L, f->upvals[0]->v, gt); 1006 setobj(L, f->upvals[0]->v, gt);
1007 luaC_upvalbarrier(L, f->upvals[0]); 1007 luaC_upvalbarrier(L, f->upvals[0], gt);
1008 } 1008 }
1009 } 1009 }
1010 lua_unlock(L); 1010 lua_unlock(L);
@@ -1253,8 +1253,8 @@ LUA_API const char *lua_setupvalue (lua_State *L, int funcindex, int n) {
1253 if (name) { 1253 if (name) {
1254 L->top--; 1254 L->top--;
1255 setobj(L, val, L->top); 1255 setobj(L, val, L->top);
1256 if (owner) { luaC_barrier(L, owner, L->top); } 1256 if (owner) { luaC_barrier(L, owner, val); }
1257 else if (uv) { luaC_upvalbarrier(L, uv); } 1257 else if (uv) { luaC_upvalbarrier(L, uv, val); }
1258 } 1258 }
1259 lua_unlock(L); 1259 lua_unlock(L);
1260 return name; 1260 return name;
@@ -1300,7 +1300,7 @@ LUA_API void lua_upvaluejoin (lua_State *L, int fidx1, int n1,
1300 *up1 = *up2; 1300 *up1 = *up2;
1301 (*up1)->refcount++; 1301 (*up1)->refcount++;
1302 if (upisopen(*up1)) (*up1)->u.open.touched = 1; 1302 if (upisopen(*up1)) (*up1)->u.open.touched = 1;
1303 luaC_upvalbarrier(L, *up1); 1303 luaC_upvalbarrier(L, *up1, (*up1)->v);
1304} 1304}
1305 1305
1306 1306