[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Weird behavior with metatables (bug?)
- From: Mike Pall <mikelu-1108@...>
- Date: Wed, 10 Aug 2011 11:39:01 +0200
Xavier Wang wrote:
> Are there any patch to 5.1.4 or 5.2-beta to solve this bug?
See the attached files.
--Mike
--- lua-5.1.4/src/lvm.c.orig
+++ lua-5.1.4/src/lvm.c
@@ -141,6 +141,7 @@
if (!ttisnil(oldval) || /* result is no nil? */
(tm = fasttm(L, h->metatable, TM_NEWINDEX)) == NULL) { /* or no TM? */
setobj2t(L, oldval, val);
+ h->flags = 0;
luaC_barriert(L, h, val);
return;
}
--- lua-5.2.0-beta/src/lvm.c.orig
+++ lua-5.2.0-beta/src/lvm.c
@@ -136,6 +136,7 @@
if (!ttisnil(oldval) || /* result is not nil? */
(tm = fasttm(L, h->metatable, TM_NEWINDEX)) == NULL) { /* or no TM? */
setobj2t(L, oldval, val);
+ h->flags = 0;
luaC_barrierback(L, obj2gco(h), val);
return;
}