Fixing uninitialized warnings in parser.c

This commit is contained in:
Wolfgang Bumiller 2012-12-26 20:00:17 +01:00
parent 33c7707f56
commit f832b86dcd

View file

@ -2512,11 +2512,6 @@ static bool parse_switch(parser_t *parser, ast_block *block, ast_expression **ou
while (parser->tok != '}') {
ast_block *caseblock;
if (parser->tok != TOKEN_KEYWORD) {
ast_delete(switchnode);
parseerror(parser, "expected 'case' or 'default'");
return false;
}
if (!strcmp(parser_tokval(parser), "case")) {
if (!parser_next(parser)) {
ast_delete(switchnode);
@ -2545,6 +2540,11 @@ static bool parse_switch(parser_t *parser, ast_block *block, ast_expression **ou
return false;
}
}
else {
ast_delete(switchnode);
parseerror(parser, "expected 'case' or 'default'");
return false;
}
/* Now the colon and body */
if (parser->tok != ':') {