mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-22 02:53:09 +00:00
lua 5.3.2 bugfix,see http://lua-users.org/lists/lua-l/2016-01/msg00000.html
This commit is contained in:
@@ -200,18 +200,19 @@ void luaV_finishset (lua_State *L, const TValue *t, TValue *key,
|
||||
for (loop = 0; loop < MAXTAGLOOP; loop++) {
|
||||
const TValue *tm;
|
||||
if (oldval != NULL) {
|
||||
lua_assert(ttistable(t) && ttisnil(oldval));
|
||||
Table *h = hvalue(t);
|
||||
lua_assert(ttisnil(oldval));
|
||||
/* must check the metamethod */
|
||||
if ((tm = fasttm(L, hvalue(t)->metatable, TM_NEWINDEX)) == NULL &&
|
||||
if ((tm = fasttm(L, h->metatable, TM_NEWINDEX)) == NULL &&
|
||||
/* no metamethod; is there a previous entry in the table? */
|
||||
(oldval != luaO_nilobject ||
|
||||
/* no previous entry; must create one. (The next test is
|
||||
always true; we only need the assignment.) */
|
||||
(oldval = luaH_newkey(L, hvalue(t), key), 1))) {
|
||||
(oldval = luaH_newkey(L, h, key), 1))) {
|
||||
/* no metamethod and (now) there is an entry with given key */
|
||||
setobj2t(L, cast(TValue *, oldval), val);
|
||||
invalidateTMcache(hvalue(t));
|
||||
luaC_barrierback(L, hvalue(t), val);
|
||||
invalidateTMcache(h);
|
||||
luaC_barrierback(L, h, val);
|
||||
return;
|
||||
}
|
||||
/* else will try the metamethod */
|
||||
|
||||
Reference in New Issue
Block a user