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 a bugfix from lua.org/bugs, h...



details:   https://anonhg.NetBSD.org/src/rev/a0bf51034e03
branches:  trunk
changeset: 358128:a0bf51034e03
user:      mbalmer <mbalmer%NetBSD.org@localhost>
date:      Wed Dec 13 13:00:14 2017 +0000

description:
Apply a bugfix from lua.org/bugs,html:
lua_pushcclosure should not call the garbage collector when n is zero.

diffstat:

 external/mit/lua/dist/src/lapi.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (29 lines):

diff -r 9abfad733ff1 -r a0bf51034e03 external/mit/lua/dist/src/lapi.c
--- a/external/mit/lua/dist/src/lapi.c  Wed Dec 13 12:12:35 2017 +0000
+++ b/external/mit/lua/dist/src/lapi.c  Wed Dec 13 13:00:14 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lapi.c,v 1.9 2017/04/26 13:17:33 mbalmer Exp $ */
+/*     $NetBSD: lapi.c,v 1.10 2017/12/13 13:00:14 mbalmer Exp $        */
 
 /*
 ** Id: lapi.c,v 2.259 2016/02/29 14:27:14 roberto Exp 
@@ -541,6 +541,7 @@
   lua_lock(L);
   if (n == 0) {
     setfvalue(L->top, fn);
+    api_incr_top(L);
   }
   else {
     CClosure *cl;
@@ -554,9 +555,9 @@
       /* does not need barrier because closure is white */
     }
     setclCvalue(L, L->top, cl);
+    api_incr_top(L);
+    luaC_checkGC(L);
   }
-  api_incr_top(L);
-  luaC_checkGC(L);
   lua_unlock(L);
 }
 



Home | Main Index | Thread Index | Old Index