FFI: Fix __gc for VLA/VLS cdata objects.

This commit is contained in:
Mike Pall
2011-05-23 02:43:36 +02:00
parent 288085afbe
commit 7b21a660a8
3 changed files with 8 additions and 5 deletions

View File

@@ -55,7 +55,8 @@ void LJ_FASTCALL lj_cdata_free(global_State *g, GCcdata *cd)
{
if (LJ_UNLIKELY(cd->marked & LJ_GC_CDATA_FIN)) {
GCobj *root;
cd->marked = curwhite(g) | LJ_GC_FINALIZED;
makewhite(g, obj2gco(cd));
obj2gco(cd)->gch.marked |= LJ_GC_FINALIZED;
if ((root = gcref(g->gc.mmudata)) != NULL) {
setgcrefr(cd->nextgc, root->gch.nextgc);
setgcref(root->gch.nextgc, obj2gco(cd));