Module Name:    src
Committed By:   mbalmer
Date:           Wed Dec 13 13:00:14 UTC 2017

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

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


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/mit/lua/dist/src/lapi.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/lapi.c
diff -u src/external/mit/lua/dist/src/lapi.c:1.9 src/external/mit/lua/dist/src/lapi.c:1.10
--- src/external/mit/lua/dist/src/lapi.c:1.9	Wed Apr 26 13:17:33 2017
+++ src/external/mit/lua/dist/src/lapi.c	Wed Dec 13 13:00:14 2017
@@ -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_API void lua_pushcclosure (lua_State
   lua_lock(L);
   if (n == 0) {
     setfvalue(L->top, fn);
+    api_incr_top(L);
   }
   else {
     CClosure *cl;
@@ -554,9 +555,9 @@ LUA_API void lua_pushcclosure (lua_State
       /* 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);
 }
 

Reply via email to