diff options
Diffstat (limited to 'lvm.c')
| -rw-r--r-- | lvm.c | 18 |
1 files changed, 12 insertions, 6 deletions
| @@ -360,13 +360,19 @@ void luaV_finishset (lua_State *L, const TValue *t, TValue *key, | |||
| 360 | luaT_callTM(L, tm, t, key, val); | 360 | luaT_callTM(L, tm, t, key, val); |
| 361 | return; | 361 | return; |
| 362 | } | 362 | } |
| 363 | t = tm; /* else repeat assignment over 'tm' */ | 363 | t = tm; /* else must repeat assignment over 'tm' */ |
| 364 | luaV_fastset(t, key, val, hres, luaH_pset); | 364 | /* do the equivalent to 'luaV_fastset', but saving 'h' */ |
| 365 | if (hres == HOK) { | 365 | if (!ttistable(t)) |
| 366 | luaV_finishfastset(L, t, val); | 366 | hres = HNOTATABLE; |
| 367 | return; /* done */ | 367 | else { |
| 368 | Table *h = hvalue(t); /* next call can change the value at 't' */ | ||
| 369 | hres = luaH_pset(h, key, val); | ||
| 370 | if (hres == HOK) { | ||
| 371 | luaC_barrierback(L, obj2gco(h), val); /* luaV_finishfastset */ | ||
| 372 | return; /* done */ | ||
| 373 | } | ||
| 368 | } | 374 | } |
| 369 | /* else 'return luaV_finishset(L, t, key, val, slot)' (loop) */ | 375 | /* else 'return luaV_finishset(L, t, key, val, hres)' (loop) */ |
| 370 | } | 376 | } |
| 371 | luaG_runerror(L, "'__newindex' chain too long; possible loop"); | 377 | luaG_runerror(L, "'__newindex' chain too long; possible loop"); |
| 372 | } | 378 | } |
