Skip to content

Commit 141a4d0

Browse files
committedJan 4, 2016
1 parent fca4d67 commit 141a4d0

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed
 

‎3rd/lua/lvm.c

+6-5
Original file line numberDiff line numberDiff line change
@@ -200,18 +200,19 @@ void luaV_finishset (lua_State *L, const TValue *t, TValue *key,
200200
for (loop = 0; loop < MAXTAGLOOP; loop++) {
201201
const TValue *tm;
202202
if (oldval != NULL) {
203-
lua_assert(ttistable(t) && ttisnil(oldval));
203+
Table *h = hvalue(t);
204+
lua_assert(ttisnil(oldval));
204205
/* must check the metamethod */
205-
if ((tm = fasttm(L, hvalue(t)->metatable, TM_NEWINDEX)) == NULL &&
206+
if ((tm = fasttm(L, h->metatable, TM_NEWINDEX)) == NULL &&
206207
/* no metamethod; is there a previous entry in the table? */
207208
(oldval != luaO_nilobject ||
208209
/* no previous entry; must create one. (The next test is
209210
always true; we only need the assignment.) */
210-
(oldval = luaH_newkey(L, hvalue(t), key), 1))) {
211+
(oldval = luaH_newkey(L, h, key), 1))) {
211212
/* no metamethod and (now) there is an entry with given key */
212213
setobj2t(L, cast(TValue *, oldval), val);
213-
invalidateTMcache(hvalue(t));
214-
luaC_barrierback(L, hvalue(t), val);
214+
invalidateTMcache(h);
215+
luaC_barrierback(L, h, val);
215216
return;
216217
}
217218
/* else will try the metamethod */

0 commit comments

Comments
 (0)