From: Christoph Mallon Date: Wed, 12 Dec 2007 08:19:30 +0000 (+0000) Subject: A statement_base_t is enough space for break and continue statements. X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=65dfc72272eeb6beba7d3a53ebd9a46488000c81;p=cparser A statement_base_t is enough space for break and continue statements. [r18701] --- diff --git a/parser.c b/parser.c index 2bf5cb7..7d9b334 100644 --- a/parser.c +++ b/parser.c @@ -5201,20 +5201,20 @@ static statement_t *parse_goto(void) */ static statement_t *parse_continue(void) { - statement_t *statement; + statement_base_t *statement; if (current_loop == NULL) { errorf(HERE, "continue statement not within loop"); statement = NULL; } else { - statement = allocate_ast_zero(sizeof(statement[0])); - statement->kind = STATEMENT_CONTINUE; - statement->base.source_position = token.source_position; + statement = allocate_ast_zero(sizeof(statement[0])); + statement->kind = STATEMENT_CONTINUE; + statement->source_position = token.source_position; } eat(T_continue); expect(';'); - return statement; + return (statement_t*)statement; } /** @@ -5222,20 +5222,20 @@ static statement_t *parse_continue(void) */ static statement_t *parse_break(void) { - statement_t *statement; + statement_base_t *statement; if (current_switch == NULL && current_loop == NULL) { errorf(HERE, "break statement not within loop or switch"); statement = NULL; } else { - statement = allocate_ast_zero(sizeof(statement[0])); - statement->kind = STATEMENT_BREAK; - statement->base.source_position = token.source_position; + statement = allocate_ast_zero(sizeof(statement[0])); + statement->kind = STATEMENT_BREAK; + statement->source_position = token.source_position; } eat(T_break); expect(';'); - return statement; + return (statement_t*)statement; } /**