summaryrefslogtreecommitdiff
path: root/src/lj_func.c
diff options
context:
space:
mode:
authorMike Pall <mike>2010-02-10 21:45:57 +0100
committerMike Pall <mike>2010-02-10 21:45:57 +0100
commitbb0384c36628c94a2232955e0cac5cf45679039f (patch)
treed13f58838029a49fc1f7117ff9a78defc4c7fd0e /src/lj_func.c
parentd5a46621f9d1299a7e5c06c59dfc02d61dc04a79 (diff)
downloadluajit2-bb0384c36628c94a2232955e0cac5cf45679039f.tar.gz
Replace GCproto reference with bytecode PC in GCfuncL.
Diffstat (limited to 'src/lj_func.c')
-rw-r--r--src/lj_func.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lj_func.c b/src/lj_func.c
index adc8c039..7d130176 100644
--- a/src/lj_func.c
+++ b/src/lj_func.c
@@ -112,8 +112,8 @@ GCfunc *lj_func_newL(lua_State *L, GCproto *pt, GCtab *env)
fn->l.gct = ~LJ_TFUNC;
fn->l.ffid = FF_LUA;
fn->l.nupvalues = cast_byte(pt->sizeuv);
- /* NOBARRIER: The GCfunc is new (marked white). */
- setgcref(fn->l.pt, obj2gco(pt));
+ /* NOBARRIER: Really a setgcref. But the GCfunc is new (marked white). */
+ setmref(fn->l.pc, proto_bc(pt));
setgcref(fn->l.env, obj2gco(env));
fn->l.gate = (pt->flags & PROTO_IS_VARARG) ? lj_gate_lv : lj_gate_lf;
return fn;
@@ -137,7 +137,7 @@ GCfunc *lj_func_newL_gc(lua_State *L, GCproto *pt, GCfuncL *parent)
GCupval *uv;
if ((v & 0x8000)) {
uv = func_finduv(L, base + (v & 0xff));
- uv->dhash = (uint32_t)(uintptr_t)gcref(parent->pt) ^ (v << 24);
+ uv->dhash = (uint32_t)(uintptr_t)mref(parent->pc, char) ^ (v << 24);
} else {
uv = &gcref(puv[v])->uv;
}