aboutsummaryrefslogtreecommitdiff
path: root/lapi.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2011-08-17 17:26:47 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2011-08-17 17:26:47 -0300
commit89b59eee7386379e87200a86215fc6de91e49036 (patch)
tree7c82d2f7f98680787e3b235d94defef00e87133a /lapi.c
parent166dd0261a0fc012808a6448a1c46030c8db4806 (diff)
downloadlua-89b59eee7386379e87200a86215fc6de91e49036.tar.gz
lua-89b59eee7386379e87200a86215fc6de91e49036.tar.bz2
lua-89b59eee7386379e87200a86215fc6de91e49036.zip
bug: __newindex metamethod may not work if metatable is its own
metatable + luaV_settable does not create entry when there is a metamethod (and therefore entry is useless)
Diffstat (limited to 'lapi.c')
-rw-r--r--lapi.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lapi.c b/lapi.c
index 29f639a6..b1da9951 100644
--- a/lapi.c
+++ b/lapi.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lapi.c,v 2.149 2011/06/13 14:13:06 roberto Exp roberto $ 2** $Id: lapi.c,v 2.150 2011/08/09 20:58:29 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*/
@@ -732,6 +732,7 @@ LUA_API void lua_rawset (lua_State *L, int idx) {
732 t = index2addr(L, idx); 732 t = index2addr(L, idx);
733 api_check(L, ttistable(t), "table expected"); 733 api_check(L, ttistable(t), "table expected");
734 setobj2t(L, luaH_set(L, hvalue(t), L->top-2), L->top-1); 734 setobj2t(L, luaH_set(L, hvalue(t), L->top-2), L->top-1);
735 invalidateTMcache(hvalue(t));
735 luaC_barrierback(L, gcvalue(t), L->top-1); 736 luaC_barrierback(L, gcvalue(t), L->top-1);
736 L->top -= 2; 737 L->top -= 2;
737 lua_unlock(L); 738 lua_unlock(L);