diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2012-05-08 10:53:33 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2012-05-08 10:53:33 -0300 |
commit | 3cadc37f470df50deb5c920b028125b8bb6c316b (patch) | |
tree | a2a448ef80bddb0ddef2581d0692ccec3de5b159 /lvm.c | |
parent | bb1146dc3986c6f123ed6d85a26694ca8d56f94a (diff) | |
download | lua-3cadc37f470df50deb5c920b028125b8bb6c316b.tar.gz lua-3cadc37f470df50deb5c920b028125b8bb6c316b.tar.bz2 lua-3cadc37f470df50deb5c920b028125b8bb6c316b.zip |
no more 'Proto' objects on the stack. Protos are anchored on outer
Protos or on a Closure, which must be created before the Proto.
Diffstat (limited to 'lvm.c')
-rw-r--r-- | lvm.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lvm.c,v 2.147 2011/12/07 14:43:55 roberto Exp roberto $ | 2 | ** $Id: lvm.c,v 2.149 2012/01/25 21:05:40 roberto Exp roberto $ |
3 | ** Lua virtual machine | 3 | ** Lua virtual machine |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -395,7 +395,8 @@ static void pushclosure (lua_State *L, Proto *p, UpVal **encup, StkId base, | |||
395 | int nup = p->sizeupvalues; | 395 | int nup = p->sizeupvalues; |
396 | Upvaldesc *uv = p->upvalues; | 396 | Upvaldesc *uv = p->upvalues; |
397 | int i; | 397 | int i; |
398 | Closure *ncl = luaF_newLclosure(L, p); | 398 | Closure *ncl = luaF_newLclosure(L, nup); |
399 | ncl->l.p = p; | ||
399 | setclLvalue(L, ra, ncl); /* anchor new closure in stack */ | 400 | setclLvalue(L, ra, ncl); /* anchor new closure in stack */ |
400 | for (i = 0; i < nup; i++) { /* fill in its upvalues */ | 401 | for (i = 0; i < nup; i++) { /* fill in its upvalues */ |
401 | if (uv[i].instack) /* upvalue refers to local variable? */ | 402 | if (uv[i].instack) /* upvalue refers to local variable? */ |