From 42a97c115440aa71d2770d6d4cc3be645d96f4ad Mon Sep 17 00:00:00 2001 From: kugwa Date: Thu, 31 Dec 2015 20:34:52 +0800 Subject: Add missing else statement check --- src/semantic-analysis.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/semantic-analysis.c b/src/semantic-analysis.c index 121027d..0a60668 100644 --- a/src/semantic-analysis.c +++ b/src/semantic-analysis.c @@ -803,6 +803,11 @@ static bool process_statement(CcmmcAst *stmt, CcmmcSymbolTable *table) any_error = check_relop_expr(stmt->child, table) || any_error; any_error = process_statement(stmt->child->right_sibling, table) || any_error; + if (stmt->child->right_sibling->right_sibling->type_node + != CCMMC_AST_NODE_NUL) + any_error = process_statement( + stmt->child->right_sibling->right_sibling, + table) || any_error; break; case CCMMC_KIND_STMT_FUNCTION_CALL: any_error = check_call(stmt, table) || any_error; -- cgit v1.2.3