mirror of
https://github.com/CPunch/Cosmo.git
synced 2024-11-25 00:21:05 +00:00
these values can be defined at the top of the function
This commit is contained in:
parent
4ed1c79b50
commit
3a872fb83f
@ -112,6 +112,9 @@ static bool readCObjString(UndumpState *udstate, CObjString **str)
|
||||
|
||||
static bool readCObjFunction(UndumpState *udstate, CObjFunction **func)
|
||||
{
|
||||
size_t constants;
|
||||
CValue val;
|
||||
|
||||
*func = cosmoO_newFunction(udstate->state);
|
||||
|
||||
check(readCObjString(udstate, &(*func)->name));
|
||||
@ -128,10 +131,8 @@ static bool readCObjFunction(UndumpState *udstate, CObjFunction **func)
|
||||
readVector(udstate, (void **)&(*func)->chunk.lineInfo, sizeof(int), &(*func)->chunk.count));
|
||||
|
||||
/* read constants */
|
||||
size_t constants;
|
||||
check(readSize(udstate, &constants));
|
||||
for (int i = 0; i < constants; i++) {
|
||||
CValue val;
|
||||
check(readCValue(udstate, &val));
|
||||
addConstant(udstate->state, &(*func)->chunk, val);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user