Fixed error handling from the Code function handlers
This commit is contained in:
parent
a058529d60
commit
00da3ddba8
@ -269,16 +269,18 @@ static int _external_declaration(C99 * c99)
|
|||||||
static int _function_definition(C99 * c99)
|
static int _function_definition(C99 * c99)
|
||||||
/* compound-statement */
|
/* compound-statement */
|
||||||
{
|
{
|
||||||
int ret;
|
int ret = 0;
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
fprintf(stderr, "DEBUG: %s()\n", __func__);
|
fprintf(stderr, "DEBUG: %s()\n", __func__);
|
||||||
#endif
|
#endif
|
||||||
ret = code_function_begin(c99->code, c99->identifier);
|
if(code_function_begin(c99->code, c99->identifier) != 0)
|
||||||
|
ret |= _parse_error(c99, error_get());
|
||||||
free(c99->identifier);
|
free(c99->identifier);
|
||||||
c99->identifier = NULL;
|
c99->identifier = NULL;
|
||||||
ret |= _compound_statement(c99);
|
ret |= _compound_statement(c99);
|
||||||
ret |= code_function_end(c99->code);
|
if(code_function_end(c99->code) != 0)
|
||||||
|
ret |= _parse_error(c99, error_get());
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user