Module Name:    src
Committed By:   mbalmer
Date:           Thu Sep  7 12:52:29 UTC 2017

Modified Files:
        src/external/mit/lua/dist/src: lgc.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/mit/lua/dist/src/lgc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/mit/lua/dist/src/lgc.c
diff -u src/external/mit/lua/dist/src/lgc.c:1.8 src/external/mit/lua/dist/src/lgc.c:1.9
--- src/external/mit/lua/dist/src/lgc.c:1.8	Wed Apr 26 13:17:33 2017
+++ src/external/mit/lua/dist/src/lgc.c	Thu Sep  7 12:52:29 2017
@@ -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 @@ static void clearkeys (global_State *g, 
     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 */
     }
   }
 }

Reply via email to