lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


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;
       }