mirror of
https://github.com/CPunch/Cosmo.git
synced 2026-01-06 23:20:36 +00:00
minor refactor, fixed many warnings
This commit is contained in:
@@ -287,8 +287,10 @@ static uint16_t identifierConstant(CParseState *pstate, CToken *name) {
|
||||
}
|
||||
|
||||
static void addLocal(CParseState *pstate, CToken name) {
|
||||
if (pstate->compiler->localCount > UINT8_MAX)
|
||||
return error(pstate, "UInt overflow! Too many locals in scope!");
|
||||
if (pstate->compiler->localCount > UINT8_MAX) {
|
||||
error(pstate, "UInt overflow! Too many locals in scope!");
|
||||
return;
|
||||
}
|
||||
|
||||
Local *local = &pstate->compiler->locals[pstate->compiler->localCount++];
|
||||
local->name = name;
|
||||
@@ -1494,4 +1496,4 @@ CObjFunction* cosmoP_compileString(CState *state, const char *source, const char
|
||||
freeParseState(&parser);
|
||||
cosmoM_unfreezeGC(state);
|
||||
return resFunc;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user