summaryrefslogtreecommitdiff
path: root/lapi.c
diff options
context:
space:
mode:
Diffstat (limited to 'lapi.c')
-rw-r--r--lapi.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lapi.c b/lapi.c
index 1c4d07dd..02b7fab7 100644
--- a/lapi.c
+++ b/lapi.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lapi.c,v 2.258 2016/01/05 16:07:21 roberto Exp roberto $ 2** $Id: lapi.c,v 2.259.1.2 2017/12/06 18:35:12 roberto Exp $
3** Lua API 3** Lua API
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -533,6 +533,7 @@ LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n) {
533 lua_lock(L); 533 lua_lock(L);
534 if (n == 0) { 534 if (n == 0) {
535 setfvalue(L->top, fn); 535 setfvalue(L->top, fn);
536 api_incr_top(L);
536 } 537 }
537 else { 538 else {
538 CClosure *cl; 539 CClosure *cl;
@@ -546,9 +547,9 @@ LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n) {
546 /* does not need barrier because closure is white */ 547 /* does not need barrier because closure is white */
547 } 548 }
548 setclCvalue(L, L->top, cl); 549 setclCvalue(L, L->top, cl);
550 api_incr_top(L);
551 luaC_checkGC(L);
549 } 552 }
550 api_incr_top(L);
551 luaC_checkGC(L);
552 lua_unlock(L); 553 lua_unlock(L);
553} 554}
554 555