diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2003-10-20 15:42:41 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2003-10-20 15:42:41 -0200 |
commit | c51bcf4796d1e39bb9840825a72085c9a51ec402 (patch) | |
tree | 221a63329b5fc7cbca88110c36022df8026b13e9 /lfunc.c | |
parent | 03bab90303270534ba6a415b5379d4659757082d (diff) | |
download | lua-c51bcf4796d1e39bb9840825a72085c9a51ec402.tar.gz lua-c51bcf4796d1e39bb9840825a72085c9a51ec402.tar.bz2 lua-c51bcf4796d1e39bb9840825a72085c9a51ec402.zip |
it's ok to dump functions with upvalues
Diffstat (limited to 'lfunc.c')
-rw-r--r-- | lfunc.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lfunc.c,v 1.67 2003/03/18 12:50:04 roberto Exp roberto $ | 2 | ** $Id: lfunc.c,v 1.68 2003/10/02 19:21:09 roberto Exp roberto $ |
3 | ** Auxiliary functions to manipulate prototypes and closures | 3 | ** Auxiliary functions to manipulate prototypes and closures |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -45,6 +45,15 @@ Closure *luaF_newLclosure (lua_State *L, int nelems, TObject *e) { | |||
45 | } | 45 | } |
46 | 46 | ||
47 | 47 | ||
48 | UpVal *luaF_newupval (lua_State *L) { | ||
49 | UpVal *p = luaM_new(L, UpVal); | ||
50 | luaC_link(L, valtogco(p), LUA_TUPVAL); | ||
51 | p->v = &p->value; | ||
52 | setnilvalue(p->v); | ||
53 | return p; | ||
54 | } | ||
55 | |||
56 | |||
48 | UpVal *luaF_findupval (lua_State *L, StkId level) { | 57 | UpVal *luaF_findupval (lua_State *L, StkId level) { |
49 | GCObject **pp = &L->openupval; | 58 | GCObject **pp = &L->openupval; |
50 | UpVal *p; | 59 | UpVal *p; |