From 89b59eee7386379e87200a86215fc6de91e49036 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 17 Aug 2011 17:26:47 -0300 Subject: 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) --- lapi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lapi.c') diff --git a/lapi.c b/lapi.c index 29f639a6..b1da9951 100644 --- a/lapi.c +++ b/lapi.c @@ -1,5 +1,5 @@ /* -** $Id: lapi.c,v 2.149 2011/06/13 14:13:06 roberto Exp roberto $ +** $Id: lapi.c,v 2.150 2011/08/09 20:58:29 roberto Exp roberto $ ** Lua API ** See Copyright Notice in lua.h */ @@ -732,6 +732,7 @@ LUA_API void lua_rawset (lua_State *L, int idx) { t = index2addr(L, idx); api_check(L, ttistable(t), "table expected"); setobj2t(L, luaH_set(L, hvalue(t), L->top-2), L->top-1); + invalidateTMcache(hvalue(t)); luaC_barrierback(L, gcvalue(t), L->top-1); L->top -= 2; lua_unlock(L); -- cgit v1.2.3-55-g6feb