lua

A copy of the Lua development repository
Log | Files | Refs | README

commit 545f43065ff8fa20e5f8254e6270d00694b847dd
parent 3819c30e5553b98ceb7d8d2da20c9da25cbdc62a
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date:   Fri,  4 Jun 2010 10:05:51 -0300

'luaF_newLclosure' gets prototype of new closure as argument

Diffstat:
Mldo.c | 5++---
Mlfunc.h | 4++--
2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/ldo.c b/ldo.c @@ -1,5 +1,5 @@ /* -** $Id: ldo.c,v 2.86 2010/04/18 13:22:48 roberto Exp roberto $ +** $Id: ldo.c,v 2.87 2010/05/05 18:49:56 roberto Exp roberto $ ** Stack and Call structure of Lua ** See Copyright Notice in lua.h */ @@ -630,8 +630,7 @@ static void f_parser (lua_State *L, void *ud) { : luaY_parser(L, p->z, &p->buff, &p->varl, p->name); setptvalue2s(L, L->top, tf); incr_top(L); - cl = luaF_newLclosure(L, tf->sizeupvalues); - cl->l.p = tf; + cl = luaF_newLclosure(L, tf); setclvalue(L, L->top - 1, cl); for (i = 0; i < tf->sizeupvalues; i++) /* initialize upvalues */ cl->l.upvals[i] = luaF_newupval(L); diff --git a/lfunc.h b/lfunc.h @@ -1,5 +1,5 @@ /* -** $Id: lfunc.h,v 2.4 2005/04/25 19:24:10 roberto Exp roberto $ +** $Id: lfunc.h,v 2.5 2010/03/26 20:58:11 roberto Exp roberto $ ** Auxiliary functions to manipulate prototypes and closures ** See Copyright Notice in lua.h */ @@ -20,7 +20,7 @@ LUAI_FUNC Proto *luaF_newproto (lua_State *L); LUAI_FUNC Closure *luaF_newCclosure (lua_State *L, int nelems); -LUAI_FUNC Closure *luaF_newLclosure (lua_State *L, int nelems); +LUAI_FUNC Closure *luaF_newLclosure (lua_State *L, Proto *p); LUAI_FUNC UpVal *luaF_newupval (lua_State *L); LUAI_FUNC UpVal *luaF_findupval (lua_State *L, StkId level); LUAI_FUNC void luaF_close (lua_State *L, StkId level);