mirror of
https://github.com/etlegacy/etlegacy-libs.git
synced 2024-11-10 23:01:47 +00:00
parent
d80d955ba7
commit
ba0f2a4383
1 changed files with 6 additions and 5 deletions
|
@ -190,18 +190,19 @@ void luaV_finishset (lua_State *L, const TValue *t, TValue *key,
|
||||||
for (loop = 0; loop < MAXTAGLOOP; loop++) {
|
for (loop = 0; loop < MAXTAGLOOP; loop++) {
|
||||||
const TValue *tm;
|
const TValue *tm;
|
||||||
if (oldval != NULL) {
|
if (oldval != NULL) {
|
||||||
lua_assert(ttistable(t) && ttisnil(oldval));
|
Table *h = hvalue(t); /* save 't' table */
|
||||||
|
lua_assert(ttisnil(oldval));
|
||||||
/* must check the metamethod */
|
/* 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? */
|
/* no metamethod; is there a previous entry in the table? */
|
||||||
(oldval != luaO_nilobject ||
|
(oldval != luaO_nilobject ||
|
||||||
/* no previous entry; must create one. (The next test is
|
/* no previous entry; must create one. (The next test is
|
||||||
always true; we only need the assignment.) */
|
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 */
|
/* no metamethod and (now) there is an entry with given key */
|
||||||
setobj2t(L, cast(TValue *, oldval), val);
|
setobj2t(L, cast(TValue *, oldval), val);
|
||||||
invalidateTMcache(hvalue(t));
|
invalidateTMcache(h);
|
||||||
luaC_barrierback(L, hvalue(t), val);
|
luaC_barrierback(L, h, val);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/* else will try the metamethod */
|
/* else will try the metamethod */
|
||||||
|
|
Loading…
Reference in a new issue