From 3cadc37f470df50deb5c920b028125b8bb6c316b Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 8 May 2012 10:53:33 -0300 Subject: no more 'Proto' objects on the stack. Protos are anchored on outer Protos or on a Closure, which must be created before the Proto. --- lfunc.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'lfunc.c') diff --git a/lfunc.c b/lfunc.c index 8b8f05c1..746f388c 100644 --- a/lfunc.c +++ b/lfunc.c @@ -1,5 +1,5 @@ /* -** $Id: lfunc.c,v 2.27 2010/06/30 14:11:17 roberto Exp roberto $ +** $Id: lfunc.c,v 2.28 2012/01/20 22:05:50 roberto Exp roberto $ ** Auxiliary functions to manipulate prototypes and closures ** See Copyright Notice in lua.h */ @@ -27,10 +27,9 @@ Closure *luaF_newCclosure (lua_State *L, int n) { } -Closure *luaF_newLclosure (lua_State *L, Proto *p) { - int n = p->sizeupvalues; +Closure *luaF_newLclosure (lua_State *L, int n) { Closure *c = &luaC_newobj(L, LUA_TLCL, sizeLclosure(n), NULL, 0)->cl; - c->l.p = p; + c->l.p = NULL; c->l.nupvalues = cast_byte(n); while (n--) c->l.upvals[n] = NULL; return c; -- cgit v1.2.3-55-g6feb