aboutsummaryrefslogtreecommitdiff
path: root/lapi.c
diff options
context:
space:
mode:
Diffstat (limited to 'lapi.c')
-rw-r--r--lapi.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/lapi.c b/lapi.c
index c1880663..14fbe114 100644
--- a/lapi.c
+++ b/lapi.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lapi.c,v 1.218 2002/11/07 15:39:23 roberto Exp roberto $ 2** $Id: lapi.c,v 1.219 2002/11/14 11:51:50 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*/
@@ -191,7 +191,7 @@ LUA_API void lua_insert (lua_State *L, int index) {
191LUA_API void lua_replace (lua_State *L, int index) { 191LUA_API void lua_replace (lua_State *L, int index) {
192 lua_lock(L); 192 lua_lock(L);
193 api_checknelems(L, 1); 193 api_checknelems(L, 1);
194 setobj(luaA_index(L, index), L->top - 1); /* unknown destination */ 194 setobj(luaA_index(L, index), L->top - 1); /* write barrier */
195 L->top--; 195 L->top--;
196 lua_unlock(L); 196 lua_unlock(L);
197} 197}
@@ -438,7 +438,7 @@ LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n) {
438 cl->c.f = fn; 438 cl->c.f = fn;
439 L->top -= n; 439 L->top -= n;
440 while (n--) 440 while (n--)
441 setobj(&cl->c.upvalue[n], L->top+n); 441 setobj2n(&cl->c.upvalue[n], L->top+n);
442 setclvalue(L->top, cl); 442 setclvalue(L->top, cl);
443 api_incr_top(L); 443 api_incr_top(L);
444 lua_unlock(L); 444 lua_unlock(L);
@@ -565,7 +565,7 @@ LUA_API void lua_rawset (lua_State *L, int index) {
565 api_checknelems(L, 2); 565 api_checknelems(L, 2);
566 t = luaA_index(L, index); 566 t = luaA_index(L, index);
567 api_check(L, ttistable(t)); 567 api_check(L, ttistable(t));
568 setobj2t(luaH_set(L, hvalue(t), L->top-2), L->top-1); 568 setobj2t(luaH_set(L, hvalue(t), L->top-2), L->top-1); /* write barrier */
569 L->top -= 2; 569 L->top -= 2;
570 lua_unlock(L); 570 lua_unlock(L);
571} 571}
@@ -577,7 +577,7 @@ LUA_API void lua_rawseti (lua_State *L, int index, int n) {
577 api_checknelems(L, 1); 577 api_checknelems(L, 1);
578 o = luaA_index(L, index); 578 o = luaA_index(L, index);
579 api_check(L, ttistable(o)); 579 api_check(L, ttistable(o));
580 setobj2t(luaH_setnum(L, hvalue(o), n), L->top-1); 580 setobj2t(luaH_setnum(L, hvalue(o), n), L->top-1); /* write barrier */
581 L->top--; 581 L->top--;
582 lua_unlock(L); 582 lua_unlock(L);
583} 583}
@@ -593,11 +593,11 @@ LUA_API int lua_setmetatable (lua_State *L, int objindex) {
593 api_check(L, ttistable(mt)); 593 api_check(L, ttistable(mt));
594 switch (ttype(obj)) { 594 switch (ttype(obj)) {
595 case LUA_TTABLE: { 595 case LUA_TTABLE: {
596 hvalue(obj)->metatable = hvalue(mt); 596 hvalue(obj)->metatable = hvalue(mt); /* write barrier */
597 break; 597 break;
598 } 598 }
599 case LUA_TUSERDATA: { 599 case LUA_TUSERDATA: {
600 uvalue(obj)->uv.metatable = hvalue(mt); 600 uvalue(obj)->uv.metatable = hvalue(mt); /* write barrier */
601 break; 601 break;
602 } 602 }
603 default: { 603 default: {