diff options
Diffstat (limited to 'lvm.c')
-rw-r--r-- | lvm.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lvm.c,v 2.120 2010/05/13 19:53:05 roberto Exp roberto $ | 2 | ** $Id: lvm.c,v 2.121 2010/06/04 13:25:10 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 | */ |
@@ -368,7 +368,9 @@ static Closure *getcached (Proto *p, UpVal **encup, StkId base) { | |||
368 | 368 | ||
369 | /* | 369 | /* |
370 | ** create a new Lua closure, push it in the stack, and initialize | 370 | ** create a new Lua closure, push it in the stack, and initialize |
371 | ** its upvalues | 371 | ** its upvalues. Note that the call to 'luaC_barrierproto' must come |
372 | ** before the assignment to 'p->cache', as the function needs the | ||
373 | ** orginal value of that field. | ||
372 | */ | 374 | */ |
373 | static void pushclosure (lua_State *L, Proto *p, UpVal **encup, StkId base, | 375 | static void pushclosure (lua_State *L, Proto *p, UpVal **encup, StkId base, |
374 | StkId ra) { | 376 | StkId ra) { |
@@ -383,8 +385,8 @@ static void pushclosure (lua_State *L, Proto *p, UpVal **encup, StkId base, | |||
383 | else /* get upvalue from enclosing function */ | 385 | else /* get upvalue from enclosing function */ |
384 | ncl->l.upvals[i] = encup[uv[i].idx]; | 386 | ncl->l.upvals[i] = encup[uv[i].idx]; |
385 | } | 387 | } |
386 | p->cache = ncl; /* save it on cache, so it can be reused */ | 388 | luaC_barrierproto(L, p, ncl); |
387 | luaC_barrierproto(L, obj2gco(p)); | 389 | p->cache = ncl; /* save it on cache for reuse */ |
388 | } | 390 | } |
389 | 391 | ||
390 | 392 | ||