diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2011-08-17 17:26:47 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2011-08-17 17:26:47 -0300 |
commit | 89b59eee7386379e87200a86215fc6de91e49036 (patch) | |
tree | 7c82d2f7f98680787e3b235d94defef00e87133a /ltable.h | |
parent | 166dd0261a0fc012808a6448a1c46030c8db4806 (diff) | |
download | lua-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 'ltable.h')
-rw-r--r-- | ltable.h | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ltable.h,v 2.14 2010/06/25 12:18:10 roberto Exp roberto $ | 2 | ** $Id: ltable.h,v 2.15 2011/08/09 20:58:29 roberto Exp roberto $ |
3 | ** Lua tables (hash) | 3 | ** Lua tables (hash) |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -15,11 +15,14 @@ | |||
15 | #define gval(n) (&(n)->i_val) | 15 | #define gval(n) (&(n)->i_val) |
16 | #define gnext(n) ((n)->i_key.nk.next) | 16 | #define gnext(n) ((n)->i_key.nk.next) |
17 | 17 | ||
18 | #define invalidateTMcache(t) ((t)->flags = 0) | ||
19 | |||
18 | 20 | ||
19 | LUAI_FUNC const TValue *luaH_getint (Table *t, int key); | 21 | LUAI_FUNC const TValue *luaH_getint (Table *t, int key); |
20 | LUAI_FUNC void luaH_setint (lua_State *L, Table *t, int key, TValue *value); | 22 | LUAI_FUNC void luaH_setint (lua_State *L, Table *t, int key, TValue *value); |
21 | LUAI_FUNC const TValue *luaH_getstr (Table *t, TString *key); | 23 | LUAI_FUNC const TValue *luaH_getstr (Table *t, TString *key); |
22 | LUAI_FUNC const TValue *luaH_get (Table *t, const TValue *key); | 24 | LUAI_FUNC const TValue *luaH_get (Table *t, const TValue *key); |
25 | LUAI_FUNC TValue *luaH_newkey (lua_State *L, Table *t, const TValue *key); | ||
23 | LUAI_FUNC TValue *luaH_set (lua_State *L, Table *t, const TValue *key); | 26 | LUAI_FUNC TValue *luaH_set (lua_State *L, Table *t, const TValue *key); |
24 | LUAI_FUNC Table *luaH_new (lua_State *L); | 27 | LUAI_FUNC Table *luaH_new (lua_State *L); |
25 | LUAI_FUNC void luaH_resize (lua_State *L, Table *t, int nasize, int nhsize); | 28 | LUAI_FUNC void luaH_resize (lua_State *L, Table *t, int nasize, int nhsize); |