mirror of
https://github.com/CPunch/Cosmo.git
synced 2024-11-05 08:10:05 +00:00
fixed GC bug in cundump.c
This commit is contained in:
parent
c945c56482
commit
e854c5dbb3
@ -117,6 +117,9 @@ static bool readCObjFunction(UndumpState *udstate, CObjFunction **func)
|
|||||||
|
|
||||||
*func = cosmoO_newFunction(udstate->state);
|
*func = cosmoO_newFunction(udstate->state);
|
||||||
|
|
||||||
|
/* make sure our GC can see that we're currently using this function (and the values it uses) */
|
||||||
|
cosmoV_pushRef(udstate->state, (CObj *)*func);
|
||||||
|
|
||||||
check(readCObjString(udstate, &(*func)->name));
|
check(readCObjString(udstate, &(*func)->name));
|
||||||
check(readCObjString(udstate, &(*func)->module));
|
check(readCObjString(udstate, &(*func)->module));
|
||||||
|
|
||||||
@ -137,6 +140,8 @@ static bool readCObjFunction(UndumpState *udstate, CObjFunction **func)
|
|||||||
addConstant(udstate->state, &(*func)->chunk, val);
|
addConstant(udstate->state, &(*func)->chunk, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* pop function off stack */
|
||||||
|
cosmoV_pop(udstate->state);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user