Source-Changes-HG archive

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

[src/trunk]: src/external/mit/lua/dist/src Apply bug fix from lua.org/bugs.ht...



details:   https://anonhg.NetBSD.org/src/rev/037a65f8eedd
branches:  trunk
changeset: 826478:037a65f8eedd
user:      mbalmer <mbalmer%NetBSD.org@localhost>
date:      Thu Sep 07 12:52:29 2017 +0000

description:
Apply bug fix from lua.org/bugs.html (dead keys with nil values can stay
in weak tables).

diffstat:

 external/mit/lua/dist/src/lgc.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (20 lines):

diff -r 2e12ce41300f -r 037a65f8eedd external/mit/lua/dist/src/lgc.c
--- a/external/mit/lua/dist/src/lgc.c   Thu Sep 07 10:30:46 2017 +0000
+++ b/external/mit/lua/dist/src/lgc.c   Thu Sep 07 12:52:29 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lgc.c,v 1.8 2017/04/26 13:17:33 mbalmer Exp $  */
+/*     $NetBSD: lgc.c,v 1.9 2017/09/07 12:52:29 mbalmer Exp $  */
 
 /*
 ** Id: lgc.c,v 2.215 2016/12/22 13:08:50 roberto Exp 
@@ -647,8 +647,9 @@
     for (n = gnode(h, 0); n < limit; n++) {
       if (!ttisnil(gval(n)) && (iscleared(g, gkey(n)))) {
         setnilvalue(gval(n));  /* remove value ... */
-        removeentry(n);  /* and remove entry from table */
       }
+      if (ttisnil(gval(n)))  /* is entry empty? */
+        removeentry(n);  /* remove entry from table */
     }
   }
 }



Home | Main Index | Thread Index | Old Index