LJ_GC64: Set correct nil value when clearing a cdata finalizer.

Thanks to Stefan Pejic.
This commit is contained in:
Mike Pall 2016-06-03 06:54:06 +02:00
parent cc05e79181
commit ce1ad870c3

View File

@ -93,11 +93,13 @@ void lj_cdata_setfin(lua_State *L, GCcdata *cd, GCobj *obj, uint32_t it)
setcdataV(L, &tmp, cd); setcdataV(L, &tmp, cd);
lj_gc_anybarriert(L, t); lj_gc_anybarriert(L, t);
tv = lj_tab_set(L, t, &tmp); tv = lj_tab_set(L, t, &tmp);
setgcV(L, tv, obj, it); if (it == LJ_TNIL) {
if (!tvisnil(tv)) setnilV(tv);
cd->marked |= LJ_GC_CDATA_FIN;
else
cd->marked &= ~LJ_GC_CDATA_FIN; cd->marked &= ~LJ_GC_CDATA_FIN;
} else {
setgcV(L, tv, obj, it);
cd->marked |= LJ_GC_CDATA_FIN;
}
} }
} }