diff options
-rw-r--r-- | lapi.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lapi.c,v 2.276 2017/11/07 13:25:26 roberto Exp roberto $ | 2 | ** $Id: lapi.c,v 2.277 2017/11/23 19:29:04 roberto Exp roberto $ |
3 | ** Lua API | 3 | ** Lua API |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -550,6 +550,7 @@ LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n) { | |||
550 | lua_lock(L); | 550 | lua_lock(L); |
551 | if (n == 0) { | 551 | if (n == 0) { |
552 | setfvalue(s2v(L->top), fn); | 552 | setfvalue(s2v(L->top), fn); |
553 | api_incr_top(L); | ||
553 | } | 554 | } |
554 | else { | 555 | else { |
555 | CClosure *cl; | 556 | CClosure *cl; |
@@ -563,9 +564,9 @@ LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n) { | |||
563 | /* does not need barrier because closure is white */ | 564 | /* does not need barrier because closure is white */ |
564 | } | 565 | } |
565 | setclCvalue(L, s2v(L->top), cl); | 566 | setclCvalue(L, s2v(L->top), cl); |
567 | api_incr_top(L); | ||
568 | luaC_checkGC(L); | ||
566 | } | 569 | } |
567 | api_incr_top(L); | ||
568 | luaC_checkGC(L); | ||
569 | lua_unlock(L); | 570 | lua_unlock(L); |
570 | } | 571 | } |
571 | 572 | ||