summaryrefslogtreecommitdiff
path: root/lapi.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2014-06-19 15:27:20 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2014-06-19 15:27:20 -0300
commit89b56e7d84d84de58fcc9d540c2003c6c2f8c134 (patch)
tree85ba9c3aa3cdb5ff57fd4f82bf322fb2e75e7292 /lapi.c
parent14929f5764a7990dfb62c8792cfdfe03c061da21 (diff)
downloadlua-89b56e7d84d84de58fcc9d540c2003c6c2f8c134.tar.gz
lua-89b56e7d84d84de58fcc9d540c2003c6c2f8c134.tar.bz2
lua-89b56e7d84d84de58fcc9d540c2003c6c2f8c134.zip
more precision between closure types ('LClosure' x 'CClosure')
Diffstat (limited to 'lapi.c')
-rw-r--r--lapi.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lapi.c b/lapi.c
index 106da209..a4b51194 100644
--- a/lapi.c
+++ b/lapi.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lapi.c,v 2.217 2014/06/10 19:13:26 roberto Exp roberto $ 2** $Id: lapi.c,v 2.218 2014/06/12 19:07:30 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*/
@@ -580,15 +580,15 @@ LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n) {
580 setfvalue(L->top, fn); 580 setfvalue(L->top, fn);
581 } 581 }
582 else { 582 else {
583 Closure *cl; 583 CClosure *cl;
584 api_checknelems(L, n); 584 api_checknelems(L, n);
585 api_check(L, n <= MAXUPVAL, "upvalue index too large"); 585 api_check(L, n <= MAXUPVAL, "upvalue index too large");
586 luaC_checkGC(L); 586 luaC_checkGC(L);
587 cl = luaF_newCclosure(L, n); 587 cl = luaF_newCclosure(L, n);
588 cl->c.f = fn; 588 cl->f = fn;
589 L->top -= n; 589 L->top -= n;
590 while (n--) { 590 while (n--) {
591 setobj2n(L, &cl->c.upvalue[n], L->top + n); 591 setobj2n(L, &cl->upvalue[n], L->top + n);
592 /* does not need barrier because closure is white */ 592 /* does not need barrier because closure is white */
593 } 593 }
594 setclCvalue(L, L->top, cl); 594 setclCvalue(L, L->top, cl);