freebsd-ports/lang/lua53/files/patch-src__lgc.c
Thomas Zander 0779926ea3 Fix multiple runtime errors and crashes in lua 5.3.4
Details
- Import upstream patches for known runtime errors
  and crashes in lua 5.3.4
  Details, see https://www.lua.org/bugs.html
  in the section on version 5.3.4

PR:		222581
Submitted by:	russ.haley@gmail.com
Approved by:	maintainer timeout
MFH:		2017Q4
2017-11-11 12:48:53 +00:00

13 lines
483 B
C

--- src/lgc.c.orig 2016-12-22 13:08:50 UTC
+++ src/lgc.c
@@ -643,8 +643,9 @@ static void clearkeys (global_State *g, GCObject *l, 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 */
}
}
}